]> git.ipfire.org Git - thirdparty/psycopg.git/commit
feat(crdb): cusomize CockroachDB connection
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 17 May 2022 00:28:53 +0000 (02:28 +0200)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Tue, 12 Jul 2022 11:58:33 +0000 (12:58 +0100)
commit066b5dfb96ddee83b85dc1f10b48ac2c19e3b43e
tree7529d7671f92f1190bf7c9a20b05f0df14877991
parent23ca7790be0efcb8e0b59795f66ca143d6828150
feat(crdb): cusomize CockroachDB connection

- Add ConnectionInfo.vendor
- Add ConnectionInfo subclassing
- Add CrdbConnectionInfo subclass with crdb_version attribute
- Add 'psycopg.crdb' module with adapters
- Dump strings using the text oid by default on CockroachDB

The latter change might have wider consequences, however crdb casts
strings to other types more easily than what Postgres does. At a glance
it might work; porting the rest of the test suite will tell.

test_adapt tests ported. Tests showing a difference moved to
crdb/test_adapt.
13 files changed:
psycopg/psycopg/connection.py
psycopg/psycopg/connection_async.py
psycopg/psycopg/conninfo.py
psycopg/psycopg/crdb.py [new file with mode: 0644]
tests/crdb/__init__.py [new file with mode: 0644]
tests/crdb/test_adapt.py [new file with mode: 0644]
tests/crdb/test_conninfo.py [new file with mode: 0644]
tests/fix_crdb.py
tests/fix_db.py
tests/test_adapt.py
tests/test_conninfo.py
tests/test_psycopg_dbapi20.py
tests/utils.py