Skip to main content

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 .

For users building from the arrow-adbc source repository, you can alternately use CMake to manage library dependencies and set environment variables for you. Assuming you specify -DADBC_DRIVER_POSTGRESQL=ON you can also add -DADBC_BUILD_PYTHON=ON to define a python target.

For example, assuming you run cmake from the project root:

cmake -S c -B build --preset debug -DADBC_BUILD_PYTHON=ON -DADBC_DRIVER_POSTSGRESQL=ON
cmake --build build --target python

will properly build and install the Python library for you.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adbc_driver_postgresql-1.4.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distributions

adbc_driver_postgresql-1.4.0-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3 Windows x86-64

adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ x86-64

adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.2 MB view details)

Uploaded Python 3 manylinux: glibc 2.17+ ARM64

adbc_driver_postgresql-1.4.0-py3-none-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded Python 3 macOS 11.0+ ARM64

adbc_driver_postgresql-1.4.0-py3-none-macosx_10_15_x86_64.whl (2.7 MB view details)

Uploaded Python 3 macOS 10.15+ x86-64

File details

Details for the file adbc_driver_postgresql-1.4.0.tar.gz.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0.tar.gz
Algorithm Hash digest
SHA256 0bc9c34911b8d1a2e333ee5ef3d284a6517a8f20d5509b2c183cb4cf8337efc7
MD5 71dad5cb9bcb2c635dd32fae20f83f54
BLAKE2b-256 2a8b5d088a3c4d739a3a62df081a819117df924318b5044ab3214d72723591ad

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.4.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 10ae2584e47928e15da8ca541bbf594de13d6c1afc8c1adad6af3f832cf0a5fc
MD5 4631a99817d69554e8b43ebe9445c3d8
BLAKE2b-256 7dfc19fb644ab228040a01971e21bb42c98c48a95d3701e68dd38fa1bfb0bc61

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d04b2ea0353bacca814fb15c5da0d407888d27e86b4f3f58d66ebe71a2e8d3da
MD5 c77a4b307abd43c5a35257e05da85d65
BLAKE2b-256 42bd910e7b8e0d6e91f94348fe23a2f8d3dfc4e86a0b933b26d41a4298f14772

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ce4e30ced25802acd6d0baad70e7b9c7394869043c1349206218d51d27613c1
MD5 843a5760768bdbe2047722570c400f40
BLAKE2b-256 2d5edc25c82cf2055e500b2f8e47093cf6037fd636866e0e6c54ccadccda1e6a

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.4.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c75827a5cfdc8ea429c21292ac6bd598a64a42af53797c7ace3ad2b3044ddc71
MD5 d1fe62b20cb8d9fe23ccdfcfe71befbc
BLAKE2b-256 7c37d991e047b931a3f005156a43c8be92ffbfd234589d5969b38adee03faa80

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.4.0-py3-none-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.4.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ca62087f1496192c3131a30fc3e4d2710fa3b31b1982bf8374b6a05fdc446513
MD5 eca8708b71dcb84685046e086c1725e8
BLAKE2b-256 fa69165a7155a9514aa472beae1e16fc93c51a363c7deed0db7d2d470c28788d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page