diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-11-29 23:35:16 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-11-29 23:35:16 +0000 |
commit | 7857a1de32169858367446d11089c34f8daee957 (patch) | |
tree | 48a35acde7cfb298de8d52102f45a2afcdff312b /lib/sqlalchemy/sql | |
parent | 78833af4e650d37e6257cfbb541e4db56e2a285f (diff) | |
parent | 0b239579f03c82f7669d77c238e4fda8638fb9c3 (diff) | |
download | sqlalchemy-7857a1de32169858367446d11089c34f8daee957.tar.gz |
Merge "Add value-level hooks for SQL type detection; apply to Range" into main
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r-- | lib/sqlalchemy/sql/sqltypes.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index a0f56d839..92708bb40 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -3682,6 +3682,10 @@ _type_map_get = _type_map.get def _resolve_value_to_type(value: Any) -> TypeEngine[Any]: _result_type = _type_map_get(type(value), False) + + if _result_type is False: + _result_type = getattr(value, "__sa_type_engine__", False) + if _result_type is False: # use inspect() to detect SQLAlchemy built-in # objects. |