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
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 Distribution
Built Distributions
File details
Details for the file adbc_driver_postgresql-1.3.0.tar.gz
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf048d4c115cb336d691f41a3717abcfc0f8b92fa12fd5f47ec8af1db7a4dd13 |
|
MD5 | 2de12d6c1eb122da0b3a10713b5b32f5 |
|
BLAKE2b-256 | 0bf70bdbb0e306b761278212beeaed16d6bf3199d8e40efd9748455565e11bff |
File details
Details for the file adbc_driver_postgresql-1.3.0-py3-none-win_amd64.whl
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0-py3-none-win_amd64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15d2cd179af465b39f028cc8f3d24258fb6b905d9076b5f47ff08c4911fa8512 |
|
MD5 | 5c90b7fd6749abbdef7dc8c7be1d89d1 |
|
BLAKE2b-256 | 3dbaee8e68e5701bdb741061f5772b44a5b7d69b8f7ed6d923d9e5e4709269a6 |
File details
Details for the file adbc_driver_postgresql-1.3.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d154eb8e5210811c9325c90e8ef93b6e33dd9be87dd079179b921de7c0866c71 |
|
MD5 | c631b850285e4b1f2846d8a22091de14 |
|
BLAKE2b-256 | 9ca3c95288412f9d7b3706cdea100dcca68483e8684ae8874854ea4183b0f5b2 |
File details
Details for the file adbc_driver_postgresql-1.3.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3, manylinux: glibc 2.27+ ARM64, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ca5f7ab119441e79c5b636c238056fff04fa341c2a677728f8ca98d24906c97 |
|
MD5 | cec2bc9078cc6beb92b22e2444ac4104 |
|
BLAKE2b-256 | 5974424a8a2c9dc284ac0890223893212a6bc91aaa12e8a570e6bb9b3cc184f4 |
File details
Details for the file adbc_driver_postgresql-1.3.0-py3-none-macosx_11_0_arm64.whl
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d8c67d2c270203f53d1ccc18ed80f8a5026938ebdc319ea4fa8e3f27edd6bca |
|
MD5 | da0f6563f4d845cf720442804b648971 |
|
BLAKE2b-256 | 2aaa3783288d05a99632083c314d90c9d47d015740ac53cfae9d3d69df668d03 |
File details
Details for the file adbc_driver_postgresql-1.3.0-py3-none-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: adbc_driver_postgresql-1.3.0-py3-none-macosx_10_15_x86_64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 146df8c83bbd236c4a290f212e286aae114bc282da98334814b29ff0216d0cab |
|
MD5 | be7a43cdca3987709085be8db7133dec |
|
BLAKE2b-256 | e57b243fbb714f1c6c9812e5020eb5c73d54055c274b051d5bce50a87cd7c9a8 |