Skip to main content
https://github.com/zillow/ctds/workflows/CI/CD/badge.svg?branch=master https://ci.appveyor.com/api/projects/status/voa33r7qdnxh6wwp/branch/master?svg=true http://img.shields.io/pypi/v/ctds.svg https://codecov.io/gh/zillow/ctds/branch/master/graph/badge.svg

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

The full documentation for cTDS can be found here.

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, Python 3.5, Python 3.6, Python 3.7, Python 3.8, and Python 3.9 support.

  • Bulk insert (bcp) support.

  • Written entirely in C.

Dependencies

See installation instructions for more information on installing FreeTDS.

Releasing

Publishing new versions of the egg and documentation is automated using a Github Actions workflow. Official releases are marked using git tags. Pushing the tag to the git remote will trigger the automated deployment. E.g.

git tag -a v1.2.3 -m 'v1.2.3'
git push --tags

Documentation

Generate documentation using the following:

tox -e docs
# Generated to build/docs/

Documentation is hosted on GitHub Pages. As such, the source code for the documentation pages must be committed to the gh-pages branch in order to update the live documentation.

Development

Local development and testing is supported on Linux-based systems running tox and Docker. Docker containers are used for running a local instance of SQL Server on Linux. Only Docker and tox are required for running tests locally on Linux or OS X systems. pyenv is recommended for managing multiple local versions of Python. By default all tests are run against the system version of FreeTDS. GNU Make targets are provided to make compiling specific FreeTDS versions locally for testing purposes. For example:

# Run tests against FreeTDS version 1.1.24
make test-1.1.24

Development and testing will require an instance of SQL Server on Linux running for validation. A script, ./scripts/ensure-sqlserver.sh, is provided to start a Docker container running the database and create the login used by the tests.

# Start a docker-based SQL Server instance.
# The default tox targets will do this automatically for you.
make start-sqlserver

# Run tests as needed ...

# Stop the docker-base SQL Server instance.
make stop-sqlserver

Testing

Testing is designed to be relatively seamless using Docker containers and SQL Server on Linux. The pytest framework is used for running the automated tests.

To run the tests against the system version of FreeTDS and Python, use:

tox

GNU make targets are provided for convenience and to provide a standard method for building and installing the various versions of FreeTDS used in testing. Most targets are wrappers around tox or replicate some behavior in the CI/CD automation.

To run the tests against an arbitrary version of FreeTDS:

# Python X.Y & FreeTDS Z.ZZ.ZZ
make test_X.Y_Z.ZZ.ZZ

To run tests against all supported versions of FreeTDS and Python and additional linting and metadata checks:

make check

Valgrind

valgrind is utilized to ensure memory is managed properly and to detect defects such as memory leaks, buffer overruns, etc. Because valgrind requires Python is compiled with specific flags, a Docker file is provided to compile Python as necessary to run the test suite under valgrind.

To run test test suite under valgrind:

make valgrind

Release files for ctds 1.14.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ctds 1.14.0
File Size Uploaded
ctds-1.14.0.tar.gz 78.0 kB Details

Release files / ctds-1.14.0.tar.gz

Download URL ctds-1.14.0.tar.gz
Size 78.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4b5bbef80a60284297c9d221a5ad3bec78f26ad4f950e899c2fcc322166f82fa
BLAKE2b-256 checksum
How to use checksums
4ea9c4301ddaa10c4d42b937c4c8da9cd5fda688f772bfb37a5b7ee67ce22c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.9.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.14.0 This release

1 release file

1.13.0

1 release file

1.12.0

1 release file

1.11.0

1 release file

1.10.1

1 release file

1.10.0

1 release file

1.9.0

1 release file

1.8.0

1 release file

1.7.0

1 release file

1.6.3

1 release file

1.6.2

1 release file

1.6.1

1 release file

1.6.0

1 release file

1.5.0

1 release file

1.4.1

1 release file

1.4.0

1 release file

1.3.2

1 release file

1.3.1

1 release file

1.3.0

1 release file

1.2.3

1 release file

1.2.2

1 release file

1.2.1

1 release file

1.2.0

1 release file

1.1.0

1 release file

1.0.8

1 release file

1.0.7

1 release file

1.0.6

1 release file

1.0.5

1 release file

1.0.4

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page