Skip to content

wiltondb/pyodbc

 
 

Repository files navigation

pyodbc

AppVeyor Github Actions - Ubuntu Build PyPI

Babelfish patch

babelfish branch in this repo includes a patch with a workaround to sp_describe_undeclared_parameters problem that happens when PyODBC is used with Babelfish for PostgreSQL.

With this change SQLDescribeParam is NOT used by default for None arguments. To restore original behaviour new use_describeparam_for_none=True argument needs to be specified to pyodbc.connect() call.

When SQLDescribeParam is not used, PyODBC cannot correctly recognize NULL values passed to varbinary parameters declared as values(?, ?...). In this case varbinary parameters must be explicitly casted in query like this: values(cast(? as varbinary(max)), ?...).

Prebuit Windows binaries with Babelfish patch - download.

Original readme

pyodbc is an open source Python module that makes accessing ODBC databases simple. It implements the DB API 2.0 specification but is packed with even more Pythonic convenience.

The easiest way to install pyodbc is to use pip:

pip install pyodbc

On Macs, you should probably install unixODBC first if you don't already have an ODBC driver manager installed, e.g. using Homebrew:

brew install unixodbc
pip install pyodbc

Similarly, on Unix you should make sure you have an ODBC driver manager installed before installing pyodbc. See the docs for more information about how to do this on different Unix flavors. (On Windows, the ODBC driver manager is built-in.)

Precompiled binary wheels are provided for multiple Python versions on most Windows, macOS, and Linux platforms. On other platforms pyodbc will be built from the source code. Note, pyodbc contains C++ extensions so when building from source you will need a suitable C++ compiler. See the docs for details.

Documentation

Release Notes

IMPORTANT: Python 2.7 support is being ended. The pyodbc 4.x versions will be the last to support Python 2.7. The pyodbc 5.x versions will support only Python 3.7 and above.

About

Python ODBC bridge with a Babelfish patch

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 64.3%
  • C++ 30.1%
  • C 3.4%
  • Batchfile 1.2%
  • Other 1.0%