]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Make a common approach for "emulated" types
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 23 Sep 2017 16:19:56 +0000 (12:19 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Sep 2017 23:30:51 +0000 (19:30 -0400)
commit35a1f5481a28837490037a6bd99d63590f748933
treecd42d87738d90c015fdb09a93f2f379234982360
parent08430e689f1a0190f671636016b12ff2ca08531f
Make a common approach for "emulated" types

Internal refinements to the :class:`.Enum`, :class:`.Interval`, and
:class:`.Boolean` types, which now extend a common mixin
:class:`.Emulated` that indicates a type that provides Python-side
emulation of a DB native type, switching out to the DB native type when a
supporting backend is in use.   The Postgresql :class:`.INTERVAL` type
when used directly will now include the correct type coercion rules for
SQL expressions that also take effect for :class:`.sqltypes.Interval`
(such as adding a date to an interval yields a datetime).

Change-Id: Ifb9f9d7cbd9f5990dcb2abb583193e9e92b789ad
Fixes: #4088
doc/build/changelog/unreleased_12/4088.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mysql/enumerated.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/psycopg2.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
test/dialect/mysql/test_types.py
test/dialect/postgresql/test_types.py
test/sql/test_metadata.py
test/sql/test_types.py