tree: a97b40d03385725f63f0a3dfea66d0d5b644607c [path history] [tgz]
  1. adbc-driver-postgresql.pc.in
  2. AdbcDriverPostgreSQLConfig.cmake.in
  3. CMakeLists.txt
  4. CMakeUserPresets.example.json
  5. connection.cc
  6. connection.h
  7. database.cc
  8. database.h
  9. postgres_copy_reader.h
  10. postgres_copy_reader_test.cc
  11. postgres_type.h
  12. postgres_type_test.cc
  13. postgres_util.h
  14. postgresql.cc
  15. postgresql_test.cc
  16. README.md
  17. statement.cc
  18. statement.h
  19. vcpkg.json
c/driver/postgresql/README.md

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.