Code Monkey home page Code Monkey logo

django-dbmaker's Introduction

django-dbmaker ============= ## django-dbmaker support for DBMaker

django-dbmaker is a Django DBMaker DB backend powered by the pyodbc library. pyodbc is a mature, viable way to access DBMaker from Python in multiple platforms and is actively maintained.

This is a fork of the original django-pyodbc, hosted on Google Code and last updated in 2017.

Features

Installation

  1. Install django-dbmaker.

    git clone https://github.com/dbmaker-go/django-dbmaker
    cd django-dbmaker
    python setup.py install
  2. Now you can now add a database to your settings using standard ODBC parameters. Note: you need to create utf-8 database first before add it to your settings.

    DATABASES = {
       'default': {
          'ENGINE':'django_dbmaker',
          'NAME':'DBName',
          'HOST': 'HostIp:Port',
          'USER':'UserName',
          'PASSWORD':'',
          'TEST_CREATE':False,
          'USE_TZ':False,
          'OPTIONS':{
              'driver':'DBMaker 5.4 Driver',
          },
       }
    }
  3. That's it! You're done.*

    * You may need to configure your machine and drivers to do an ODBC connection to your database server, if you haven't already. For Linux this involves installing and configuring Unix ODBC and FreeTDS . Iterate on the command line to test your pyodbc connection like:

    python -c 'import pyodbc; print(pyodbc.connect("DSN=DBSAMPLE5;UID=SYSADM;PWD=").cursor().execute("select 1"))'

Configuration

The following settings control the behavior of the backend:

Standard Django settings

NAME String. Database name. Required.

HOST String. instance in server\instance or ip,port format.

USER String. Database user name. If not given then MS Integrated Security

will be used.

PASSWORD String. Database user password.

TEST_CREATE Boolean. Indicates if test need to create test db or keep db.

OPTIONS Dictionary. Current available keys:

  • driver

    String. ODBC Driver to use. Default is "DBMaker 5.4 Driver".

  • SELTMPBB

    Boolean. Default False will set isolation committed, this may cause more lock timeout error if concurrent select/update on same record very frequently. Set True will set isolation level uncommited for select does not held lock, this may reduce lock timeout for concurrent select/update on same record. It will also cast blob to temp blob for select query as a snapshot of the blob for select statement to prevent incorrect access for blob.

From the original project README.

  • All the Django core developers, especially Malcolm Tredinnick. For being an example of technical excellence and for building such an impressive community.
  • The Oracle Django team (Matt Boersma, Ian Kelly) for some excellent ideas when it comes to implement a custom Django DB backend.

django-dbmaker's People

Contributors

lidonglifighting avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.