]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Implement `TypeEngine.as_generic`
authorGord Thompson <gord@gordthompson.com>
Mon, 7 Dec 2020 23:37:29 +0000 (18:37 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 9 Dec 2020 00:54:05 +0000 (19:54 -0500)
commitb71e46f0470964358d44aec08f940260f78691f0
tree44c9b5934ad550b4688700e8124204411e42190f
parent18b1b261ff988549e75b011f2f4296fb13b24d64
Implement `TypeEngine.as_generic`

Added :meth:`_types.TypeEngine.as_generic` to map dialect-specific types,
such as :class:`sqlalchemy.dialects.mysql.INTEGER`, with the "best match"
generic SQLAlchemy type, in this case :class:`_types.Integer`.  Pull
request courtesy Andrew Hannigan.

Abstract away how we check for "overridden methods" so it is more
clear what the intent is and that the methodology can be
independently tested.

Fixes: #5659
Closes: #5714
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5714
Pull-request-sha: 91afb9a0ba3bfa81a1ded80c025989213cf6e4eb

Change-Id: Ic54d6690ecc10dc69e6e72856d5620036cea472a
doc/build/changelog/unreleased_14/5659.rst [new file with mode: 0644]
doc/build/core/reflection.rst
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/sql/events.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/langhelpers.py
test/base/test_utils.py
test/sql/test_types.py