Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
/ peewee-mssql Public archive

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

License

Notifications You must be signed in to change notification settings

COUR4G3/peewee-mssql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Peewee

Does not work with the latest 3.x version of Peewee, use 2.x for now.

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages