A libpq-based ADBC driver for working with PostgreSQL.
Project description
ADBC PostgreSQL Driver for Python
This package contains bindings for the PostgreSQL driver, using the driver manager to provide a DBAPI 2.0/PEP 249-compatible interface on top.
Example
import adbc_driver_postgresql.dbapi
uri = "postgresql://postgres:password@localhost:5432/postgres"
with adbc_driver_postgresql.dbapi.connect(uri) as conn:
with conn.cursor() as cur:
cur.execute("SELECT 1")
print(cur.fetch_arrow_table())
Building
Dependencies: a build of the PostgreSQL driver, and the
adbc-driver-manager
Python package. Optionally, install PyArrow to
use the DBAPI 2.0-compatible interface.
Set the environment variable ADBC_POSTGRESQL_LIBRARY
to the path to
libadbc_driver_postgresql.{dll,dylib,so}
before running pip install
.
# If not already installed
pip install -e ../adbc_driver_manager
export ADBC_POSTGRESQL_LIBRARY=/path/to/libadbc_driver_postgresql.so
pip install --no-deps -e .
See CONTRIBUTING.md for details on the general build process.
Testing
A running instance of PostgreSQL is required. For example, using Docker:
$ docker run -it --rm \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=tempdb \
-p 5432:5432 \
postgres
Then, to run the tests, set the environment variable specifying the PostgreSQL URI before running tests:
$ export ADBC_POSTGRESQL_TEST_URI=postgresql://localhost:5432/postgres?user=postgres&password=password
$ pytest -vvx
See CONTRIBUTING.md for details on the general test process.
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
Hashes for adbc_driver_postgresql-0.8.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e5dae4cf57352cc885327117515f59e374483dc2b1c3532a4fdaf9057ca1042 |
|
MD5 | 8bcbcbe26ae56c6f2bbb453e16b5ccde |
|
BLAKE2b-256 | f2d5c154c669c526bf1ae1062a4ab4475c9e3799e8454cf9c05956ff09d41560 |
Hashes for adbc_driver_postgresql-0.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a99951e4551eff04d79a50e436b2d36034f98f09314b07578c3ee5d0db27cb6c |
|
MD5 | d0a670abcd37009daab0bf07d139154b |
|
BLAKE2b-256 | 50f690886e82db326c6e741d3718803906438da76601eb7d16fbaf3b540ec5c7 |
Hashes for adbc_driver_postgresql-0.8.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a007fae50bd578aa7693cfe93657c2909acf0067b637a60b7aeacadce5d12c07 |
|
MD5 | 3f63675cdfc67ed7634460ef14fb5b7f |
|
BLAKE2b-256 | d5f422ee4689d4f2fbed81a02f6352baf709ac19a57c2819e7f420f6f1860a3d |
Hashes for adbc_driver_postgresql-0.8.0-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9149366c2b010f2710129a2fd2f118c8f2361c86b818b98036ed00c024cb0792 |
|
MD5 | f460ff48629527b36c3d6ed80dd1b8f7 |
|
BLAKE2b-256 | 1f5779a901cda5020688fab0520fb89f65c93fb9819934852ec6c6a301c13f62 |
Hashes for adbc_driver_postgresql-0.8.0-py3-none-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd01bbf013469666d9d38ac03bec7f302812dddf9ddd6e8274d4e9243d3403d8 |
|
MD5 | 6b1df9f03bca8ec188f0fd427499c804 |
|
BLAKE2b-256 | 40f50bd3268b75bde37a09c69d35e6c4845450f82a88e07c089791101dd874ea |