]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
implement second-level type resolution for literals
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Jan 2022 17:20:46 +0000 (12:20 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 11 Jan 2022 14:24:34 +0000 (09:24 -0500)
commit8a62aa58fa5eeaad4e6bdd994a00293f41eb3a71
treeaa650722adc96ffd85a2988f9a9d2f4bf1f7c6ff
parent9298ce03e1181d5bc00c1891663433606ead1223
implement second-level type resolution for literals

Added additional rule to the system that determines ``TypeEngine``
implementations from Python literals to apply a second level of adjustment
to the type, so that a Python datetime with or without tzinfo can set the
``timezone=True`` parameter on the returned :class:`.DateTime` object, as
well as :class:`.Time`. This helps with some round-trip scenarios on
type-sensitive PostgreSQL dialects such as asyncpg, psycopg3 (2.0 only).

For 1.4 specifically, the backport improves support for asyncpg handling of
TIME WITH TIMEZONE, which was not fully implemented. 2.0's reworked
PostgreSQL architecture had this handled already.

Fixes: #7537
Change-Id: Icdb07db85af5f7f39f1c1ef855fe27609770094b
doc/build/changelog/unreleased_14/7537.rst [new file with mode: 0644]
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/testing/requirements.py
lib/sqlalchemy/testing/suite/test_types.py
test/requirements.py