Skip to main content

Database driver to add Microsoft SQL Server/Azure support to Peewee

Project description

A database driver to add Microsoft SQL Server and Azure support using pymssql and FreeTDS in Peewee and should run on most Unix-like systems, Microsoft Windows and Mac OS X.

In it’s current state you should be able to access data and possibly do certain updates. You will not be able to create tables or introspect existing databases, so you will have to write your models manually. Offsets will also not work, since the query compiler will need some significant rewrite to support TSQL dialect, however limit will work (TOP).

Installation

Install the latest stable release from Pypi:

$ pip install peewee-mssql

Or alternatively, select a release or development version from Github and run:

$ python setup.py install

Getting Started

For help on installing and configuring FreeTDS I recommend taking a look at the guide in the pymssql documentation.

And then you should be able to instantiate a database as below and start building your models for accessing data:

from peewee_mssql import MssqlDatabase

db = MssqlDatabase('MyDatabase', host='host.example.com', user='domain\\username', password='password')

If you are using Microsoft SQL Server 2005 you will need to use the legacy datetime data types, simple pass use_legacy_datetime=True to the database driver when initializing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

peewee-mssql-0.1.0.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file peewee-mssql-0.1.0.tar.gz.

File metadata

File hashes

Hashes for peewee-mssql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7ddab29c9813bfdc70901d4244ed5650bbe8edcf4cee7e9d1d0a901345e9d81a
MD5 ce89369970a29586e6b9c47ad427c8da
BLAKE2b-256 c03c0f824c9ec89d2c22002209c6ee9a841af94e929d4e2d1a70925ba26485e4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page