]> git.ipfire.org Git - thirdparty/psycopg.git/commit
Adapt the dumper used to the value of the objects
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 20 Jan 2021 01:46:45 +0000 (02:46 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Wed, 20 Jan 2021 01:59:16 +0000 (02:59 +0100)
commita246e3f294f43bc5bed27ec765b838ccff69be78
tree72c1036f99046d0595aefa8e9e92552f74a7597a
parent5638e51434542cc70da0befc3b8511c416ad3a70
Adapt the dumper used to the value of the objects

Added a second dispatch to allow a dumper to upgrade to a specialised
version. Currently used to dump int to the smallest Postgres type
holding that value and to dump lists of object into typed arrays.

This change allows to write queries more naturally as no ``::int`` cast
should be needed anymore e.g. in date + int or jsonb ->> int.

Only Python implementation; C version to be implemented yet.
psycopg3/psycopg3/_transform.py
psycopg3/psycopg3/adapt.py
psycopg3/psycopg3/types/__init__.py
psycopg3/psycopg3/types/array.py
psycopg3/psycopg3/types/numeric.py
tests/test_adapt.py
tests/test_prepared.py
tests/test_prepared_async.py
tests/test_query.py
tests/types/test_array.py
tests/types/test_numeric.py