ADBC PostgreSQL Driver

This implements an ADBC driver that wraps libpq, the client library for PostgreSQL. This is still a work in progress.

This project owes credit to 0x0L's pgeon for the overall approach.

NOTE: this project is not affiliated with PostgreSQL in any way.

Building

Dependencies: libpq itself. This can be installed with your favorite package manager; however, you may need to set the PKG_CONFIG_PATH environment variable such that pkg-config can find libpq.

See CONTRIBUTING.md for details.

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

Alternatively use the docker compose provided by ADBC to manage the test database container.

$ docker compose up postgres_test
# When finished:
# docker compose down postgres_test

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
$ ctest

Users of VSCode can use the CMake extension with the supplied CMakeUserPresets.json example to supply the required CMake and environment variables required to build and run tests.