Skip to content

fed239/django_hana_pyhdb

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django DB Backend for SAP HANA

Setup

  1. Install PyHDB

  2. Install the python package via setup.py

    python setup.py install
  3. The config in the Django project is as follows

    DATABASES = {
        'default': {
            'ENGINE': 'django_hana',           # or as per your python path
            'NAME': '<SCHEMA_NAME>',           # The schema to use. It will be created if doesn't exist
            'USER': '<USERNAME>',
            'PASSWORD': '<PASSWORD>',
            'HOST': '<HOSTNAME>',                      
            'PORT': '3<INSTANCE_NUMBER>15',               
        }
    }
  4. HANA doesn't support Timezone. Set USE_TZ=False in settings.py.

Config

Column/Row store

Use the column/row-store class decorators to make sure that your models are using the correct HANA engine. If the models are not using any decorators the default behaviour will be a ROW-store column.

from django.db import models
from django_hana import column_store, row_store

@column_store
class ColumnStoreModel(models.Model):
	some_field = models.CharField()
	
@row_store
class RowStoreModel(models.Model):
	some_field = models.CharField()

Support of spatial column types

Add django.contrib.gis to your INSTALLED_APPS.

In your models.py files use

from django.contrib.gis.db.models import ...

instead of

from django.db.models import ...

Make use of the following fields:

  • PointField
  • LineStringField
  • PolygonField
  • MultiPointField
  • MulitLineString
  • MultiPolygon

Test system

  • Django 1.8
  • HDB version 1.00.094.00.1427101515

Disclaimer

This project is not a part of standard SAP HANA delivery, hence SAP support is not responsible for any queries related to this software. All queries/issues should be reported here.

About

Django db backend for SAP HANA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%