summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2022-11-29 23:35:16 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2022-11-29 23:35:16 +0000
commit7857a1de32169858367446d11089c34f8daee957 (patch)
tree48a35acde7cfb298de8d52102f45a2afcdff312b /lib/sqlalchemy/sql
parent78833af4e650d37e6257cfbb541e4db56e2a285f (diff)
parent0b239579f03c82f7669d77c238e4fda8638fb9c3 (diff)
downloadsqlalchemy-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.py4
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.