sqlalchemy_pyodbc_mssql Readme
Overview
PyODBC is Microsoft’s recommended DBAPI layer for connecting a python application to MSSQL. However, the layer is not MSSQL-specific, and so it has some limitations:
parameterized queries with GROUP BY will not always work ([source](https://github.com/mkleehammer/pyodbc/issues/479))
stored procedures (such as those called by the prepared statements in pyodbc) are limited to 2100 parameters ([source](https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server?view=sql-server-2017))
SQLAlchemy has a PyODBC dialect for MSSQL usage, but it also shares these limitations.
for GROUP BY details, see https://github.com/sqlalchemy/sqlalchemy/issues/4540
[PyMSSQL](http://www.pymssql.org) exists as an alternative DBAPI layer and dialect for SQLAlchemy. Since it prepares queries by rolling parameters into the query string itself (properly quoted, of course) rather than issuing ODBC prepared statements, it does not share the above problems.
sqlalchemy_pyodbc_mssql extends the built-in SQLAlchemy PyODBC dialect in order to work around these limits in a manner consistent with PyMSSQL’s implementation. Most queries are passed as-is to PyODBC to be prepared and executed normally. Those that would not work, due to the above issues, are given special treatment to avoid the limitations and keep the app developer from needing to keep track of when to apply workarounds.
Usage
- Installation
for usage in app: pip install sqlalchemy_pyodbc_mssql
to run tests: pip install sqlalchemy_pyodbc_mssql[tests]
- Usage
see [SQLAlchemy instructions for PyODBC usage](https://docs.sqlalchemy.org/en/13/dialects/mssql.html#module-sqlalchemy.dialects.mssql.pyodbc)
- dialect name to use is mssql+pyodbc_mssql
- examples:
mssql+pyodbc_mssql://<username>:<password>@<dsnname>
mssql+pyodbc_mssql://<username>:<password>@<dbname>?driver=SQL+Server+Native+Client+11.0
Changelog
0.1.1 released 2022-10-24
resolve cache warning from SQLAlchemy 1.4 (480007f)
0.1.0 released 2019-06-17
initial release
Metadata
Release files for sqlalchemy-pyodbc-mssql 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqlalchemy_pyodbc_mssql-0.1.1.tar.gz | 8.5 kB | Without provenance | Details for sqlalchemy_pyodbc_mssql-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqlalchemy_pyodbc_mssql-0.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for sqlalchemy_pyodbc_mssql-0.1.1-py2.py3-none-any.whl |
Total release size: 15.4 kB
Release files / sqlalchemy_pyodbc_mssql-0.1.1.tar.gz
| Download URL | sqlalchemy_pyodbc_mssql-0.1.1.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5f82776bc117e2a667c6715267f80edd242b35798009ef918596b55408dee6d
|
|
BLAKE2b-256 checksum How to use checksums |
3b18b8c6c5752ce82484e6f78bc214d93f6b239c464847db521e289e0c231bab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.15
|
Release files / sqlalchemy_pyodbc_mssql-0.1.1-py2.py3-none-any.whl
| Download URL | sqlalchemy_pyodbc_mssql-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 7.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1876b0e81bdfd53ced0ea1e2ebc489c3ed90afb174ceb87c8269426dc163687f
|
|
BLAKE2b-256 checksum How to use checksums |
b158bbf9f7d2f086f416f16782169b3c302572ca515fd98c3e222530d5d44942
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.15
|
Security for sqlalchemy-pyodbc-mssql 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.