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.7.0-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5125f0ffe72e4f34e5883b53e99a53c82f1c48534310c230c12b420f3fbb04b0 |
|
MD5 | bd8f91c4d968fc13054378397d5902ad |
|
BLAKE2b-256 | f3461bdf137bd19ee9ee118e32e06425536fb22d9344a66f60ffcfe982645e83 |
Hashes for adbc_driver_postgresql-0.7.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 044d4e6b92d29f0dde0d234ed6efcb956ba97d7bda321ed8ad0d6349403876ad |
|
MD5 | ee7727f86be188a5ff9a4df5446f7c2b |
|
BLAKE2b-256 | d8c55c873b1387262b043782597b421660ae6ee1e3cc0e07879bb91bb7ca3b7e |
Hashes for adbc_driver_postgresql-0.7.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8097e9def2444043db2781eeb4495bc490762cb8b7dc80133aa268e55248c826 |
|
MD5 | c26b7790bf5d120e2bf9eccefc629865 |
|
BLAKE2b-256 | f4e39908cac80cad414dabdaf3c46e870be18c68b4e49e5cb605a8d59b809c56 |
Hashes for adbc_driver_postgresql-0.7.0-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e018812bb5e6409fd6bdd4375d68c6d376ac02053723831df47641478cf052c |
|
MD5 | 71f9cba5807e196956bee7d673b8959f |
|
BLAKE2b-256 | cd3241d066068ee6f9593de52f0bfd96367ddcc228abdf8134468d4ba789c6af |
Hashes for adbc_driver_postgresql-0.7.0-py3-none-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2472952c3d972f3d0adc1b48492efea1e943bf7e0454258e0fc3a5e035e2282 |
|
MD5 | 56251861a616d9703823aef96a288712 |
|
BLAKE2b-256 | 3d2e2470935a920bca68d3d3f76d04001c0d94926c3457dea150ac0b7bc69cbe |