summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/json.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/json.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/json.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py
index 255f1af21..fbf61dd5f 100644
--- a/lib/sqlalchemy/dialects/postgresql/json.py
+++ b/lib/sqlalchemy/dialects/postgresql/json.py
@@ -97,12 +97,18 @@ class JSONPathType(sqltypes.JSON.JSONPathType):
class JSON(sqltypes.JSON):
"""Represent the PostgreSQL JSON type.
- This type is a specialization of the Core-level :class:`_types.JSON`
- type. Be sure to read the documentation for :class:`_types.JSON` for
- important tips regarding treatment of NULL values and ORM use.
+ :class:`_postgresql.JSON` is used automatically whenever the base
+ :class:`_types.JSON` datatype is used against a PostgreSQL backend,
+ however base :class:`_types.JSON` datatype does not provide Python
+ accessors for PostgreSQL-specific comparison methods such as
+ :meth:`_postgresql.JSON.Comparator.astext`; additionally, to use
+ PostgreSQL ``JSONB``, the :class:`_postgresql.JSONB` datatype should
+ be used explicitly.
- .. versionchanged:: 1.1 :class:`_postgresql.JSON` is now a PostgreSQL-
- specific specialization of the new :class:`_types.JSON` type.
+ .. seealso::
+
+ :class:`_types.JSON` - main documenation for the generic
+ cross-platform JSON datatype.
The operators provided by the PostgreSQL version of :class:`_types.JSON`
include:
@@ -167,6 +173,9 @@ class JSON(sqltypes.JSON):
:class:`_postgresql.JSONB`
+ .. versionchanged:: 1.1 :class:`_postgresql.JSON` is now a PostgreSQL-
+ specific specialization of the new :class:`_types.JSON` type.
+
""" # noqa
astext_type = sqltypes.Text()