Skip to main content

DB API 2.0-compliant driver for SQL Server

Project description

https://github.com/koddachad/k_ctds/actions/workflows/ci-cd.yml/badge.svg https://ci.appveyor.com/api/projects/status/tlgkdm69ldx7wc78?svg=true http://img.shields.io/pypi/v/k-ctds.svg https://codecov.io/github/koddachad/k_ctds/graph/badge.svg

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

k-cTDS is a maintained fork of cTDS, originally developed by Zillow.

The full documentation for k-cTDS can be found here.

Features

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

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

k_ctds-1.15.0.tar.gz (130.7 kB view details)

Uploaded Source

File details

Details for the file k_ctds-1.15.0.tar.gz.

File metadata

  • Download URL: k_ctds-1.15.0.tar.gz
  • Upload date:
  • Size: 130.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for k_ctds-1.15.0.tar.gz
Algorithm Hash digest
SHA256 881b281e6e16078543167a4979227e3a186d725d2e9a9b0a9ae7583427b0dafe
MD5 178a3e69ebfb97e82d8029508ea688e9
BLAKE2b-256 7d4648600d398eb07b9b21aaf3fc79c3a769d9e359f11cd70abcbdebf9983854

See more details on using hashes here.

Supported by

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