Skip to main content

DB API 2.0-compliant Linux driver for SQL Server

Project description

https://travis-ci.org/zillow/ctds.svg?branch=master http://img.shields.io/pypi/dm/ctds.svg http://img.shields.io/pypi/v/ctds.svg

cTDS is a full Python DB API-2.0-compliant SQL Server database library for Linux and Mac OS X supporting both Python 2 and Python 3.

Features

  • Supports Microsoft SQL Server 2008 and up.

  • Complete DB API-2.0 support.

  • Python 2.6, Python 2.7, Python 3.3, Python 3.4, and Python 3.5 support.

  • Bulk insert (bcp) support.

  • Written entirely in C.

Documentation

The full documentation for cTDS can be found here.

Generate documentation using the following:

make doc
# Generated to build/docs/html

Development

To setup a development environment, some system packages are required. On Debian systems these can be installed using:

make setup

This will also install the supported Python versions for testing.

Testing

cTDS tests require an actual SQL Server instance to run. SQL Server Express is a free, readily available variant should a paid version not be available. The included test-setup.sql script will create the necessary database, login, etc. required for running the tests.

Additionally, the hostname for the SQL Server instance to use for the tests must be configured in the ctds/tests/database.ini configuration file.

To run the tests against the default version of Python, use:

make test

To run the tests against an arbitrary version of Python:

make test_X.Y

To run tests against all versions of Python:

make check

The tests are only run against one version of FreeTDS (0.95.87) by default. However, they can easily be run against any version of FreeTDS using the following.

make test FREETDS_VERSION=0.92.408

This will download the specified version of FreeTDS, compile it, and then run the tests.

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

ctds-1.0.3.tar.gz (53.5 kB view hashes)

Uploaded Source

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