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_POSTGRESQL=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.10.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

adbc_driver_postgresql-1.10.0-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_postgresql-1.10.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (3.4 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

adbc_driver_postgresql-1.10.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

adbc_driver_postgresql-1.10.0-py3-none-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_postgresql-1.10.0-py3-none-macosx_10_15_x86_64.whl (3.0 MB view details)

Uploaded Python 3macOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: adbc_driver_postgresql-1.10.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for adbc_driver_postgresql-1.10.0.tar.gz
Algorithm Hash digest
SHA256 4687d41180a31f6e6081dfb85cbe4b1611498d6b5c462f34ed3b7e68d20ed90d
MD5 6978acf51d217b7cdd0ac35a2a94584d
BLAKE2b-256 1415bb1d0458fb79bec75d6392d695f3dd58e3100789e6605a69e2b0e30ba1b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.10.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 81c285c08cf28faae36791f5c790a16b1d87cdee9037af874e4dcf747c21a8e2
MD5 1a5e44b40947f446bf1a16fd3321cdba
BLAKE2b-256 cea817129f60d0de09947f12dbeb25a107bef7cc265ea4f5fd5d88ed02ba58ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.10.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 a2efec61f5ba966e503081b7f058516745e95e0d965bfd9ecfcae2f6d2d4a178
MD5 31910098d11b56654f7c93b4ffb3149a
BLAKE2b-256 76f72ca5bd4d8d4edcd8721adeba20690806cf6186d9a3de217b2c5f44530c3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.10.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 e9a0f0097b33574eff87fccbf17713b8c5c0d9f6fed9c081e074989b8b4ad5cc
MD5 0e2a2861296d3b2978ba02dbb5dde541
BLAKE2b-256 3e87a997e82262f58ccc5340898f623dec8b8b80d40db48ab7b7575efd92bb6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.10.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4fa0f647498687d937646be234b5eeb464ddff503e0233351a127703fd8783ec
MD5 76647903283572df7fdde3faa7149db5
BLAKE2b-256 44725ce2a53b6d4d2bb533d3250d6f3a32e6171a82f74c712583c04bf9dabf15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.10.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e59af997b2be409b27a1feee89f702cd7f528c2c4ae0696b41e25f46fda2db27
MD5 76a92bf86d98a55037674da86bdc9bfb
BLAKE2b-256 5ff87105475d6749f709223e363dca59cf751593cbdd815acc5939e7236367f4

See more details on using hashes here.

Supported by

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