kapilratnani / django_hana

[Discontinued] Django db backend for SAP HANA
BSD 3-Clause "New" or "Revised" License
20 stars 13 forks source link

Discontinued

Please read here https://www.sap.com/india/developer/tutorials/hxe-python-django-polls.html

Django DB Backend for SAP HANA

Ready for use.

Prerequisite

  1. Python compiled with --enable-unicode=ucs2 or use the python provided with hdbclient package.
  2. Django 1.4 (Only tested with this version, 1.5 might work)
  3. HANA python driver configured in python path. Only available for windows x86_64 and linux x86_64
  4. Tested with HDB version 1.00.45.371235 (NewDB100_REL).

Setup

  1. install the python package via setup.py

    python setup.py install
  2. 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',               
        }
    }
  3. 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()

Log

TODO

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.