summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2022-08-02 12:27:57 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2022-08-17 11:50:24 -0400
commit2e7117ab1b584e678380c70625ad1331cea551d0 (patch)
tree8defd69fd3202159842511dfc4e9d22e21ad9e7a /lib/sqlalchemy/sql
parenta134ec1760df6295d537ff63df7aee83d957bf6a (diff)
downloadsqlalchemy-2e7117ab1b584e678380c70625ad1331cea551d0.tar.gz
JSONPATH type can be used in casts in PostgreSQL
Introduced the type :class:`_postgresql.JSONPATH` that can be used in cast expressions. This is required by some PostgreSQL dialects when using functions such as ``jsonb_path_exists`` or ``jsonb_path_match`` that accept a ``jsonpath`` as input. Fixes: #8216 Change-Id: I3e7337eab91680cab1604e1f3058854a0a19c5be
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/sqltypes.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py
index de833cd89..f04d583e1 100644
--- a/lib/sqlalchemy/sql/sqltypes.py
+++ b/lib/sqlalchemy/sql/sqltypes.py
@@ -2419,6 +2419,8 @@ class JSON(Indexable, TypeEngine[Any]):
"""
+ __visit_name__ = "json_path"
+
class Comparator(Indexable.Comparator[_T], Concatenable.Comparator[_T]):
"""Define comparison operations for :class:`_types.JSON`."""