tree: 75424e40324844c1a9d9d39964726fcb98efd81f [path history] [tgz]
  1. copy/
  2. adbc-driver-postgresql.pc.in
  3. AdbcDriverPostgreSQLConfig.cmake.in
  4. bind_stream.h
  5. CMakeLists.txt
  6. CMakeUserPresets.example.json
  7. connection.cc
  8. connection.h
  9. database.cc
  10. database.h
  11. error.cc
  12. error.h
  13. meson.build
  14. postgres_type.h
  15. postgres_type_test.cc
  16. postgres_util.h
  17. postgresql.cc
  18. postgresql_benchmark.cc
  19. postgresql_test.cc
  20. README.md
  21. result_helper.cc
  22. result_helper.h
  23. result_reader.cc
  24. result_reader.h
  25. statement.cc
  26. statement.h
  27. 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.