All Projects → michiya → django-pyodbc-azure

michiya / django-pyodbc-azure

Licence: BSD-3-Clause License
Django backend for Microsoft SQL Server and Azure SQL Database using pyodbc

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-pyodbc-azure

qt-sql-example
Example Qt application that connects to SQL Server and displays a table from the database
Stars: ✭ 29 (-91.13%)
Mutual labels:  odbc, mssql
sqlalchemy exasol
SQLAlchemy dialect for EXASOL
Stars: ✭ 34 (-89.6%)
Mutual labels:  odbc, pyodbc
database
Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
Stars: ✭ 25 (-92.35%)
Mutual labels:  mssql
ECommerceProjectWithWebAPI
.NET 5.0 Web API İle E-Ticaret Sitesi Yapımı MVC,Win Form,Angular ve Mobil
Stars: ✭ 35 (-89.3%)
Mutual labels:  mssql
DWKit
DWKit is a Business Process Management System based on .NET Core and React
Stars: ✭ 121 (-63%)
Mutual labels:  mssql
fake-survey-generator
A slightly more-than-trivial full-stack application built with DDD & CQRS concepts
Stars: ✭ 49 (-85.02%)
Mutual labels:  azure-sql-database
ODBC.jl
An ODBC interface for the Julia programming language
Stars: ✭ 81 (-75.23%)
Mutual labels:  odbc
typetta
Node.js ORM written in TypeScript for type lovers.
Stars: ✭ 44 (-86.54%)
Mutual labels:  mssql
space-cloud
Open source Firebase + Heroku to develop, scale and secure serverless apps on Kubernetes
Stars: ✭ 3,405 (+941.28%)
Mutual labels:  mssql
odbc-rs
Rust ODBC FFI binding
Stars: ✭ 90 (-72.48%)
Mutual labels:  odbc
dbt-synapse
dbt adapter for Azure Synapse SQL Dedicated Pools
Stars: ✭ 40 (-87.77%)
Mutual labels:  azure-sql-database
DustyTables
Thin F# API for SqlClient for easy data access to ms sql server with functional seasoning on top
Stars: ✭ 71 (-78.29%)
Mutual labels:  mssql
database
Simple and easy go database micro framework
Stars: ✭ 12 (-96.33%)
Mutual labels:  mssql
DolphinDBPlugin
No description or website provided.
Stars: ✭ 33 (-89.91%)
Mutual labels:  odbc
xelogstash
Send SQL Server Extended Events to Logstash, Elastic Search, or JSON
Stars: ✭ 22 (-93.27%)
Mutual labels:  mssql
DotNETCarRental
Daily car rental simulation with ASP.NET.
Stars: ✭ 13 (-96.02%)
Mutual labels:  mssql
docker-workshop-with-react-aspnetcore-redis-rabbitmq-mssql
An Asp.Net Core Docker workshop project that includes react ui, redis, mssql, rabbitmq and azure pipelines
Stars: ✭ 53 (-83.79%)
Mutual labels:  mssql
SQLServerTools
Инструменты обслуживания и разработки для Microsoft SQL Server, а также другие интересности
Stars: ✭ 147 (-55.05%)
Mutual labels:  mssql
YelpDatasetSQL
Working with the Yelp Dataset in Azure SQL and SQL Server
Stars: ✭ 16 (-95.11%)
Mutual labels:  mssql
bigkube
Minikube for big data with Scala and Spark
Stars: ✭ 16 (-95.11%)
Mutual labels:  mssql

django-pyodbc-azure

http://img.shields.io/pypi/v/django-pyodbc-azure.svg?style=flat http://img.shields.io/pypi/l/django-pyodbc-azure.svg?style=flat

django-pyodbc-azure is a modern fork of django-pyodbc, a Django Microsoft SQL Server external DB backend that uses ODBC by employing the pyodbc library. It supports Microsoft SQL Server and Azure SQL Database.

Features

Dependencies

  • Django 2.1
  • pyodbc 3.0 or newer

Installation

  1. Install pyodbc and Django

  2. Install django-pyodbc-azure

    pip install django-pyodbc-azure
    
  3. Now you can point the ENGINE setting in the settings file used by your Django application or project to the 'sql_server.pyodbc' module path

    'ENGINE': 'sql_server.pyodbc'
    

Configuration

Standard Django settings

The following entries in a database-level settings dictionary in DATABASES control the behavior of the backend:

  • ENGINE

    String. It must be "sql_server.pyodbc".

  • NAME

    String. Database name. Required.

  • HOST

    String. SQL Server instance in "server\instance" (on-premise) or "server.database.windows.net" (Azure SQL Database) format.

  • PORT

    String. Server instance port. An empty string means the default port.

  • USER

    String. Database user name in "user" (on-premise) or "user@server" (Azure SQL Database) format. If not given then MS Integrated Security will be used.

  • PASSWORD

    String. Database user password.

  • AUTOCOMMIT

    Boolean. Set this to False if you want to disable Django's transaction management and implement your own.

and the following entries are also available in the TEST dictionary for any given database-level settings dictionary:

  • NAME

    String. The name of database to use when running the test suite. If the default value (None) is used, the test database will use the name "test_" + NAME.

  • COLLATION

    String. The collation order to use when creating the test database. If the default value (None) is used, the test database is assigned the default collation of the instance of SQL Server.

  • DEPENDENCIES

    String. The creation-order dependencies of the database. See the official Django documentation for more details.

  • MIRROR

    String. The alias of the database that this database should mirror during testing. Default value is None. See the official Django documentation for more details.

OPTIONS

Dictionary. Current available keys are:

  • driver

    String. ODBC Driver to use ("ODBC Driver 13 for SQL Server", "SQL Server Native Client 11.0", "FreeTDS" etc). Default is "ODBC Driver 13 for SQL Server".

  • isolation_level

    String. Sets transaction isolation level for each database session. Valid values for this entry are READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SNAPSHOT, and SERIALIZABLE. Default is None which means no isolation levei is set to a database session and SQL Server default will be used.

  • dsn

    String. A named DSN can be used instead of HOST.

  • host_is_server

    Boolean. Only relevant if using the FreeTDS ODBC driver under Unix/Linux.

    By default, when using the FreeTDS ODBC driver the value specified in the HOST setting is used in a SERVERNAME ODBC connection string component instead of being used in a SERVER component; this means that this value should be the name of a dataserver definition present in the freetds.conf FreeTDS configuration file instead of a hostname or an IP address.

    But if this option is present and it's value is True, this special behavior is turned off.

    See http://www.freetds.org/userguide/dsnless.htm for more information.

  • unicode_results

    Boolean. If it is set to True, pyodbc's unicode_results feature is activated and strings returned from pyodbc are always Unicode. Default value is False.

  • extra_params

    String. Additional parameters for the ODBC connection. The format is "param=value;param=value".

  • collation

    String. Name of the collation to use when performing text field lookups against the database. Default is None; this means no collation specifier is added to your lookup SQL (the default collation of your database will be used). For Chinese language you can set it to "Chinese_PRC_CI_AS".

  • connection_timeout

    Integer. Sets the timeout in seconds for the database connection process. Default value is 0 which disables the timeout.

  • connection_retries

    Integer. Sets the times to retry the database connection process. Default value is 5.

  • connection_retry_backoff_time

    Integer. Sets the back off time in seconds for reries of the database connection process. Default value is 5.

  • query_timeout

    Integer. Sets the timeout in seconds for the database query. Default value is 0 which disables the timeout.

backend-specific settings

The following project-level settings also control the behavior of the backend:

  • DATABASE_CONNECTION_POOLING

    Boolean. If it is set to False, pyodbc's connection pooling feature won't be activated.

Example

Here is an example of the database settings:

DATABASES = {
    'default': {
        'ENGINE': 'sql_server.pyodbc',
        'NAME': 'mydb',
        'USER': 'user@myserver',
        'PASSWORD': 'password',
        'HOST': 'myserver.database.windows.net',
        'PORT': '',

        'OPTIONS': {
            'driver': 'ODBC Driver 13 for SQL Server',
        },
    },
}

# set this to False if you want to turn off pyodbc's connection pooling
DATABASE_CONNECTION_POOLING = False

Limitations

The following features are currently not supported:

  • Altering a model field from or to AutoField at migration

Notice

This version of django-pyodbc-azure only supports Django 2.1. If you want to use it on older versions of Django, specify an appropriate version number (2.0.x.x for Django 2.0) at installation like this:

pip install "django-pyodbc-azure<2.1"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].