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.11.0.tar.gz (32.3 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.11.0-py3-none-win_amd64.whl (3.1 MB view details)

Uploaded Python 3Windows x86-64

adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.26+ x86-64manylinux: glibc 2.28+ x86-64

adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (3.8 MB view details)

Uploaded Python 3manylinux: glibc 2.26+ ARM64manylinux: glibc 2.28+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

adbc_driver_postgresql-1.11.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.11.0.tar.gz.

File metadata

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

File hashes

Hashes for adbc_driver_postgresql-1.11.0.tar.gz
Algorithm Hash digest
SHA256 f5688b8648ac7a86d8b89340231bb3686ac5df56ee95d1ca0b875dad5d52b48a
MD5 112cc89e37a72c71ad2b8b03bee142b8
BLAKE2b-256 68102962c25035887cd03af3b348eac3302493936f45048c220021a802d07f12

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.11.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 95c13b3203615b816a258db91c375785750cb82395b985f16c0dc6af88b932e3
MD5 1c2e262c1582ffcf030015033ae83c65
BLAKE2b-256 a747dd2322a40537ee9e22aa9937c70614ca29e9259d1b8b17441b92fbb49d5c

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c5904ed3da009fe1361ddf6d5c1a61c8963a6d1dfeda0e96bd4445e028f37216
MD5 93594df08b50f36b58abdfafd00ab7f6
BLAKE2b-256 caf893c681d2ccd5b0e70db58998b0f61a7bf52ccf6b9e199d5055c49ef37959

See more details on using hashes here.

File details

Details for the file adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.11.0-py3-none-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 03cca73acc3840c9751305cef86aa5a9971fe2374a7aabaf1704b3582b351518
MD5 52f4209ba66699b0ca2da367598083db
BLAKE2b-256 f03263e4b41f0e4cb36a61ed62edd151ea71c4cc555b2dd554a068812c8dae52

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.11.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9678d10d7597f775efd59f74cadd0c63fc40671ee52b65e289019ae8b5a2adf0
MD5 f344acdf67a218812bfd982042da5788
BLAKE2b-256 9363eb2ea42f7451a898e11847a0b949baa06cbe212a4de09e4c62e1bf9af448

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for adbc_driver_postgresql-1.11.0-py3-none-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c54e3119998c845d895ff548c2181c73313e9a52616c61a8cd918d8b4d5279ea
MD5 37b56334585ffa615c581bf0af760a8a
BLAKE2b-256 79c7c90e2faea8f2eac9bbdf89ab3c6bad78e4d0361043cc59b63a37da143a55

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