Mytherin / psqlodbc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a clone of the PostgreSQL ODBC driver. Specifically, this repo contains the tests that are defined there for usage with the DuckDB ODBC client.

Running the tests

This directory should be cloned inside of a DuckDB directory, and pwd should be inside that directory.

git clone git@github.com:Mytherin/psqlodbc.git

After that, we build DuckDB with the ODBC driver enabled, and build the PSQL ODBC tests.

export BUILD_ODBC=1 make debug
(cd psqlodbc && make debug)

Now we can run the tests using the following script:

Warning: this script will override your ODBC driver config (~/.odbc.ini and ~/.odbcinst.ini).

./tools/odbc/test/run_psqlodbc_tests.sh

Fixing Output

If anything goes wrong running this script, we can run individual tests like this:

(cd psqlodbc && ./build/debug/psql_odbc_test [test_name])

If the test fails, but the new output looks correct (e.g. when you have changed something that causes the output to change), we can append --fix to this command to accept the new output as the correct output. For example:

(cd psqlodbc && ./build/debug/psql_odbc_test [test_name] --fix)

You may need to delete lingering database files first by running the following commands:

rm -f psqlodbc/contrib_regression
rm -f psqlodbc/contrib_regression.wal

About

License:Other


Languages

Language:C++ 85.3%Language:C 9.7%Language:CMake 3.2%Language:PLpgSQL 1.0%Language:Shell 0.8%Language:Makefile 0.1%