Giter Site home page Giter Site logo

thihara / ctds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zillow/ctds

0.0 2.0 0.0 2.01 MB

Python DB-API 2.0 library for MS SQL Server

License: MIT License

Makefile 1.54% PowerShell 1.13% Batchfile 0.17% SQLPL 0.35% Shell 0.85% Python 50.60% C 45.26% C++ 0.08%

ctds's Introduction

cTDS

https://travis-ci.org/zillow/ctds.svg?branch=master https://ci.appveyor.com/api/projects/status/voa33r7qdnxh6wwp/branch/master?svg=true

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.

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, and Python 3.6 support.
  • Bulk insert (bcp) support.
  • Written entirely in C.

Dependencies

Documentation

The full documentation for cTDS can be found here.

Generate documentation using the following:

make doc
# Generated to ./.gh-pages

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 Docker. Docker containers are used for both running a local instance of SQL Server on Linux and creating containers for each combination of Python and FreeTDS version supported. Only Docker and GNU make are required for running tests locally on Linux or OS X systems.

If desired, local development can be done by installing ctds against the system versions of FreeTDS and Python. Additionally there is a virtualenv target which will download and compile a recent version of FreeTDS and then install ctds into a virtualenv using the local version of FreeTDS.

# Install as a "develop" egg
pip install -e .

# Install tests.
pip install -e .[tests]

# Run tests (requires SQL Server running)
python setup.py test

However, given the various supported combinations of FreeTDS and Python, it is easier to create a separate Docker container for each. The matrix of FreeTDS and Python is driven using GNU make.

Development and testing will require an instance of SQL Server on Linux running for validation. A script 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.
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. All test targets will ensure a running database instance docker container exists and is accessible prior to running.

To run the tests against the most recent versions of FreeTDS and Python, use:

make test

To run the tests against an arbitrary version of FreeTDS and Python:

# 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

ctds's People

Contributors

joshuahlang avatar jpeters71 avatar

Watchers

James Cloos avatar Thihara Jayathunga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.