DB-API interface to Microsoft SQL Server for Python. (new Cython-based version)
Project description
pymssql - DB-API interface to Microsoft SQL Server
A simple database interface to Microsoft SQL Server (MS-SQL) for Python that builds on top of FreeTDS to provide a Python DB-API (PEP-249) interface to SQL Server.
Detailed information on pymssql is available on the website:
New development is happening on GitHub at:
https://github.com/pymssql/pymssql
There is a Google Group for discussion at:
https://groups.google.com/forum/?fromgroups#!forum/pymssql
Do you use pymssql?
Can you take a minute and fill out this survey to help us prioritize development tasks?
https://www.surveymonkey.com/s/KMQ8BM5
Recent Changes
Version 2.1.0 - 2014-02-25 - Marc Abramowitz
Features
Sphinx-based documentation (GH-149)
Read it online at http://pymssql.org/
Thanks, Ramiro Morales!
See:
“Green” support (GH-135)
Lets you use pymssql with cooperative multi-tasking systems like gevent and have pymssql call a callback when it is waiting for a response from the server. You can set this callback to yield to another greenlet, coroutine, etc. For example, for gevent, you could do:
def wait_callback(read_fileno): gevent.socket.wait_read(read_fileno) pymssql.set_wait_callback(wait_callback)The above is useful if you’re say, running a gunicorn server with the gevent worker. With this callback in place, when you send a query to SQL server and are waiting for a response, you can yield to other greenlets and process other requests. This is super useful when you have high concurrency and/or slow database queries and lets you use less gunicorn worker processes and still handle high concurrency.
Better error messages.
E.g.: For a connection failure, instead of:
pymssql.OperationalError: (20009, 'Net-Lib error during Connection refused')
the dberrstr is also included, resulting in:
pymssql.OperationalError: (20009, 'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist\nNet-Lib error during Connection refused\n')
See:
In the area of error messages, we also made this change:
execute: Raise ColumnsWithoutNamesError when as_dict=True and missing column names (GH-160)
because the previous behavior was very confusing; instead of raising an exception, we would just return row dicts with those columns missing. This prompted at least one question on the mailing list (https://groups.google.com/forum/?fromgroups#!topic/pymssql/JoZpmNZFtxM), so we thought it was better to handle this explicitly by raising an exception, so the user would understand what went wrong.
See:
Performance improvements
You are most likely to notice a difference from these when you are fetching a large number of rows.
Reworked row fetching (GH-159)
There was a rather large amount of type conversion occuring when fetching a row from pymssql. The number of conversions required have been cut down significantly with these changes. Thanks Damien, Churchill!
See:
Modify get_row() to use the CPython tuple API (GH-178)
This drops the previous method of building up a row tuple and switches to using the CPython API, which allows you to create a correctly sized tuple at the beginning and simply fill it in. This appears to offer around a 10% boost when fetching rows from a table where the data is already in memory. Thanks Damien, Churchill!
See:
MSSQLConnection: Add with (context manager) support (GH-171)
This adds with statement support for MSSQLConnection in the _mssql module – e.g.:
with mssqlconn() as conn: conn.execute_query("SELECT @@version AS version")We already have with statement support for the pymssql module.
See:
Allow passing in binary data (GH-179)
Use the bytearray type added in Python 2.6 to signify that this is binary data and to quote it accordingly. Also modify the handling of str/bytes types checking the first 2 characters for b’0x’ and insert that as binary data.
See:
Add support for binding uuid.UUID instances to stored procedures input params (GH-143)
Thanks, Ramiro Morales!
See:
The version number is now stored in one place, in pymssql_version.h This makes it easier to update the version number and not forget any places, like I did with pymssql 2.0.1
See:
Improved support for using py.test as test runner (GH-183)
See:
Improved PEP-8 and pylint compliance
Bug Fixes
GH-142 (“Change how *.pyx files are included in package”) - this should prevent pymssql.pyx and _mssql.pyx from getting copied into the root of your virtualenv. Thanks, @Arfrever!
See:
GH-145 (“Prevent error string growing with repeated failed connection attempts.”)
See:
GH-151 (“err_handler: Don’t clobber dberrstr with oserrstr”)
See:
GH-152 (“_mssql.pyx: Zero init global last_msg_* vars”)
See:
GH-177 (“binary columns sometimes are processed as varchar”) Better mechanism for pymssql to detect that user is passing binary data.
See:
buffer overflow fix (GH-182)
See:
Return uniqueidentifer columns as uuid.UUID objects on Python 3
Version 2.0.1 - 2013-10-27 - Marc Abramowitz
MANIFEST.in: Add “*.rst” to prevent install error: “IOError: [Errno 2] No such file or directory: ‘ChangeLog_highlights.rst’”
Version 2.0.0 - 2013-10-25 - Marc Abramowitz
First official release of pymssql 2.X (Cython-based code) to PyPI!
Compared to pymssql 1.X, this version offers:
See ChangeLog for older history…
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pymssql-2.1.0.zip.
File metadata
- Download URL: pymssql-2.1.0.zip
- Upload date:
- Size: 2.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28afbc30096d0a8b0bb896322c04a9039d8225233b52dc6fc28694297e79f84e
|
|
| MD5 |
8ffc99e86f532023fa852a880609747c
|
|
| BLAKE2b-256 |
be9846ad01138c3c7581832debefb1b7217faf4765879acaf537bd9e039a81f3
|
File details
Details for the file pymssql-2.1.0.tar.gz.
File metadata
- Download URL: pymssql-2.1.0.tar.gz
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7dbfcf8de21be1f34164a7f26f1d573b0e4c0bad5804a62f8997b99fe91ece5d
|
|
| MD5 |
e955442a8cd43456cdf5c28b75147afb
|
|
| BLAKE2b-256 |
1417e8e5adfa4e88f3c417e9985884c705b8890be01c6ab518d9ad8f156a73c5
|
File details
Details for the file pymssql-2.1.0.tar.bz2.
File metadata
- Download URL: pymssql-2.1.0.tar.bz2
- Upload date:
- Size: 1.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2ecd96a0891c4a373d5667bdce7010b2273ed1c6554fa858982b612e305b843
|
|
| MD5 |
c45e4e295aa5b0fc2a0bb3566b46a4c0
|
|
| BLAKE2b-256 |
77a6a258238a07ec7bb1e059a8d1dda1c8424d76a7274fe0bbbe1a5b3e39bebc
|
File details
Details for the file pymssql-2.1.0.win32-py3.4.exe.
File metadata
- Download URL: pymssql-2.1.0.win32-py3.4.exe
- Upload date:
- Size: 444.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cb2a9ff2d470b21892d756288741efbbdf5b7805d37422d96fdc3d6878c0868
|
|
| MD5 |
43bf439b28932ffe16cd11d5463e37ed
|
|
| BLAKE2b-256 |
18e82591abd2237c8548fb509efb756da388f58d489320f11d5466ba2ba0f92f
|
File details
Details for the file pymssql-2.1.0.win32-py3.3.exe.
File metadata
- Download URL: pymssql-2.1.0.win32-py3.3.exe
- Upload date:
- Size: 444.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
507b3b031d0c95413d4c2e214ef15223e95c971c3be9a7bef8d26f842eb11577
|
|
| MD5 |
ca28701cb4f7a8bfa864abb29d011544
|
|
| BLAKE2b-256 |
c6b0c9f68e46a1e85ba8e878e7da85e57384496a3f3085e8e6d7e2a4dee39c29
|
File details
Details for the file pymssql-2.1.0.win32-py2.7.exe.
File metadata
- Download URL: pymssql-2.1.0.win32-py2.7.exe
- Upload date:
- Size: 449.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4408659594b6eae11221ac3b5095d57dece20ab6a4cc560cf3177e0e1da4e945
|
|
| MD5 |
f02797a22ed93afa33714273d98bdecd
|
|
| BLAKE2b-256 |
02ab11ffe05fb13bcdb9703ca1fb89047959f9ce98888a75dd603b4279ee90a7
|
File details
Details for the file pymssql-2.1.0.win32-py2.6.exe.
File metadata
- Download URL: pymssql-2.1.0.win32-py2.6.exe
- Upload date:
- Size: 450.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7ade6f8a279e25494ba4022658f5610bcaec073b6fb7ee724e9633b305abf3b
|
|
| MD5 |
5b1edb9e1022cf8cd86daeaa1c427a83
|
|
| BLAKE2b-256 |
139b8aa6984488d1e31cea7ae3740e09c83a438e62960f4bb1925040626dae82
|
File details
Details for the file pymssql-2.1.0-py3.4-win32.egg.
File metadata
- Download URL: pymssql-2.1.0-py3.4-win32.egg
- Upload date:
- Size: 244.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59f17873925b2f953c4fde2be91bba0367c56836e1bc364243de9fff6974689d
|
|
| MD5 |
071ef56455625f1c8f1cd8a3d385e17e
|
|
| BLAKE2b-256 |
6a2080b7e7dd8814985103e01776ecdac0e66a6dc01a26094d39845e3861d5ce
|
File details
Details for the file pymssql-2.1.0-py3.4-macosx-10.6-intel.egg.
File metadata
- Download URL: pymssql-2.1.0-py3.4-macosx-10.6-intel.egg
- Upload date:
- Size: 297.2 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beba3b8d9e843f9f67fe223a5f5f0a096091acc23770fbf49ffeff04a25ec273
|
|
| MD5 |
85b0843729570563125e66b9d3ee71e8
|
|
| BLAKE2b-256 |
a727a9234709cd3c60240df87d8c24888f580ab85586f52b15f6ad8df1937f1f
|
File details
Details for the file pymssql-2.1.0-py3.3-win32.egg.
File metadata
- Download URL: pymssql-2.1.0-py3.3-win32.egg
- Upload date:
- Size: 244.4 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddbc7cab7e9fbc11892b10335fd6a0d7eeb8816d99847f49e305b1f30c2e96d3
|
|
| MD5 |
50a8c223e0c52ff8106c36423fa1cd3f
|
|
| BLAKE2b-256 |
e0d4a44d96f9bd5b742de5ecb8c69b3f6657e810729b6e364c411fae524636cc
|
File details
Details for the file pymssql-2.1.0-py3.3-macosx-10.6-intel.egg.
File metadata
- Download URL: pymssql-2.1.0-py3.3-macosx-10.6-intel.egg
- Upload date:
- Size: 297.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f1c430d96cb5960b453613334e58ed5bede9c7f77c403e36637e04bc1918e78
|
|
| MD5 |
93121fd3d58d9ebe0e9e74070d5757d4
|
|
| BLAKE2b-256 |
6b79528a5657fa7a686baeb9156b07fc43df9b873952d993edb421f781833209
|
File details
Details for the file pymssql-2.1.0-py2.7-win32.egg.
File metadata
- Download URL: pymssql-2.1.0-py2.7-win32.egg
- Upload date:
- Size: 244.4 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17b566d18f259a18e814f0eb41faea55df65b7dd8f13b55f8f76268aa56ee8c1
|
|
| MD5 |
bc5de44d8615ae573039c9f7168fe0de
|
|
| BLAKE2b-256 |
ed0693ad57d0aa9c29ded2f765d13139616ec7ecbbc8b971d982eddf712d3bba
|
File details
Details for the file pymssql-2.1.0-py2.7-macosx-10.4-x86_64.egg.
File metadata
- Download URL: pymssql-2.1.0-py2.7-macosx-10.4-x86_64.egg
- Upload date:
- Size: 155.6 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50dd35482a7d1df205a223d60bfdb7fd35b878616fb6ea18033562ecb26f68ea
|
|
| MD5 |
b9f53accd4c99d19152e4bb6f428b74c
|
|
| BLAKE2b-256 |
4a1c3bc9e602f072a52f176e15ffb7289ae6c020d064a0f92b01743a614f1e14
|
File details
Details for the file pymssql-2.1.0-py2.6-win32.egg.
File metadata
- Download URL: pymssql-2.1.0-py2.6-win32.egg
- Upload date:
- Size: 245.2 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05dabe63ce96c253bfb4bc707924eaabb0f685e916a946078f3f23d7a9208a9d
|
|
| MD5 |
9ce22fe279421dde2c5103be56f0e047
|
|
| BLAKE2b-256 |
31f6e26a4681cec829efae85a203afe49494c45ebe2bfd9ac5dc7d695fb5c9f1
|
File details
Details for the file pymssql-2.1.0-py2.6-macosx-10.8-intel.egg.
File metadata
- Download URL: pymssql-2.1.0-py2.6-macosx-10.8-intel.egg
- Upload date:
- Size: 306.3 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0b920ebd786c52b662e3f2e8a3c54c22d436fa24d97f7aa9d3e2eccd40e44f9
|
|
| MD5 |
35b771ee210987611cedde341d4dc640
|
|
| BLAKE2b-256 |
44ba34f48a23c1563b8c4a73da0b331f73b6f730e392356d829e84cbd0e2cb4d
|
File details
Details for the file pymssql-2.1.0-cp34-none-win32.whl.
File metadata
- Download URL: pymssql-2.1.0-cp34-none-win32.whl
- Upload date:
- Size: 246.1 kB
- Tags: CPython 3.4, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c952605a21c596a2c103aab0c913f859074750c60fa71acef27b98404c9ff4ba
|
|
| MD5 |
ef3832358ee74e46559eebff30e94fc9
|
|
| BLAKE2b-256 |
75c0af78f7299acd31cd88faa7246396b3cec2290d9c43ab977de70b7f1b584b
|
File details
Details for the file pymssql-2.1.0-cp34-cp34m-macosx_10_6_intel.whl.
File metadata
- Download URL: pymssql-2.1.0-cp34-cp34m-macosx_10_6_intel.whl
- Upload date:
- Size: 299.8 kB
- Tags: CPython 3.4m, macOS 10.6+ Intel (x86-64, i386)
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b92072233cc1138433126615e11c568a4d7dda00c34e6b3b3a220f311b8ae12
|
|
| MD5 |
142cbf2496e58409b7d2937858b049d7
|
|
| BLAKE2b-256 |
7d4aeda3682068100296e11fa19ba1251140ef5f1f6f20f28d8f1305aa76c790
|
File details
Details for the file pymssql-2.1.0-cp33-none-win32.whl.
File metadata
- Download URL: pymssql-2.1.0-cp33-none-win32.whl
- Upload date:
- Size: 246.1 kB
- Tags: CPython 3.3, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d54146079f32558ae71a4266d905b3f73e11775d691ae3a410bfe5a9691834e
|
|
| MD5 |
61800cc9e0430f499ff02af4d4af2310
|
|
| BLAKE2b-256 |
c5461f369e6ec98324dff21d44e9719c7fa72793fc183e874f17f9ccdb596623
|
File details
Details for the file pymssql-2.1.0-cp33-cp33m-macosx_10_6_intel.whl.
File metadata
- Download URL: pymssql-2.1.0-cp33-cp33m-macosx_10_6_intel.whl
- Upload date:
- Size: 300.0 kB
- Tags: CPython 3.3m, macOS 10.6+ Intel (x86-64, i386)
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c548d6816a81501fed8aca8adeeeede567b190578794a357702ba1401f876a89
|
|
| MD5 |
085a2d312c6b2c1eac51a82bfb1a23af
|
|
| BLAKE2b-256 |
400adccebfd281b8913e4499ef7c779c71ec7aa690b5c52910b67f7949e30ccd
|
File details
Details for the file pymssql-2.1.0-cp27-none-win32.whl.
File metadata
- Download URL: pymssql-2.1.0-cp27-none-win32.whl
- Upload date:
- Size: 246.2 kB
- Tags: CPython 2.7, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
626c78766f2f55a369f99642b1545cd0b2c4df9e7efa5c4c79a69bd1155fd6e7
|
|
| MD5 |
eca99ecef4e31430a3212a6ffcfca31b
|
|
| BLAKE2b-256 |
74a74d254e961cec9a3377aeb0d9d330c02e61da51e360b45549d3a127a65538
|
File details
Details for the file pymssql-2.1.0-cp27-none-macosx_10_4_x86_64.whl.
File metadata
- Download URL: pymssql-2.1.0-cp27-none-macosx_10_4_x86_64.whl
- Upload date:
- Size: 158.2 kB
- Tags: CPython 2.7, macOS 10.4+ x86-64
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f8edc391f77e1f96d04907a6f9c64b60967770d5ffe20bae14135810223e285
|
|
| MD5 |
ff8ba7918227b12acfe542517d9a8bfe
|
|
| BLAKE2b-256 |
26a930e8a8348e42bd96bcd9723f32d61c20eb5f7fc7cb50d5ed2c23822d08c1
|
File details
Details for the file pymssql-2.1.0-cp26-none-win32.whl.
File metadata
- Download URL: pymssql-2.1.0-cp26-none-win32.whl
- Upload date:
- Size: 246.6 kB
- Tags: CPython 2.6, Windows x86
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9ab8c82099e73b3ae4bfb05aa623c4c5e6e98d3a86d8b212013b997f2f6ddea
|
|
| MD5 |
ae19920575aa51efd2ec98cd5a316e43
|
|
| BLAKE2b-256 |
aef21d3340f063f003ee9dcdc48ae8fdb47a35ce98118d7c33331e83a013975f
|
File details
Details for the file pymssql-2.1.0-cp26-none-macosx_10_8_intel.whl.
File metadata
- Download URL: pymssql-2.1.0-cp26-none-macosx_10_8_intel.whl
- Upload date:
- Size: 308.9 kB
- Tags: CPython 2.6, macOS 10.8+ Intel (x86-64, i386)
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca687544d6961efb9f02cd730a0e081982c2d64330d5b03f8ac68a67fc0bafb2
|
|
| MD5 |
d8f9be4f7bb992dbf3d93f531e50ab74
|
|
| BLAKE2b-256 |
7dcdfba4e2a210f64c26ef13bc19b6d0fa7ddb844aaab2ebacab3bbafbb7aac4
|