summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/ranges.py
diff options
context:
space:
mode:
authorFederico Caselli <cfederico87@gmail.com>2020-04-19 20:09:39 +0200
committerMike Bayer <mike_mp@zzzcomputing.com>2020-04-20 11:54:20 -0400
commitaaec1bdedfc73ead3aef3a3e4d835a8df339e2dd (patch)
tree70dd9f841bcd9e9c8b14d6d7f4238abeda64fc46 /lib/sqlalchemy/dialects/postgresql/ranges.py
parent2f617f56f2acdce00b88f746c403cf5ed66d4d27 (diff)
downloadsqlalchemy-aaec1bdedfc73ead3aef3a3e4d835a8df339e2dd.tar.gz
Support `ARRAY` of `Enum`, `JSON` or `JSONB`
Added support for columns or type :class:`.ARRAY` of :class:`.Enum`, :class:`.JSON` or :class:`_postgresql.JSONB` in PostgreSQL. Previously a workaround was required in these use cases. Raise an explicit :class:`.exc.CompileError` when adding a table with a column of type :class:`.ARRAY` of :class:`.Enum` configured with :paramref:`.Enum.native_enum` set to ``False`` when :paramref:`.Enum.create_constraint` is not set to ``False`` Fixes: #5265 Fixes: #5266 Change-Id: I83a2d20a599232b7066d0839f3e55ff8b78cd8fc
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/ranges.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/ranges.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py
index 76d0aeaeb..d4f75b494 100644
--- a/lib/sqlalchemy/dialects/postgresql/ranges.py
+++ b/lib/sqlalchemy/dialects/postgresql/ranges.py
@@ -4,7 +4,6 @@
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
-from .base import ischema_names
from ... import types as sqltypes
@@ -108,9 +107,6 @@ class INT4RANGE(RangeOperators, sqltypes.TypeEngine):
__visit_name__ = "INT4RANGE"
-ischema_names["int4range"] = INT4RANGE
-
-
class INT8RANGE(RangeOperators, sqltypes.TypeEngine):
"""Represent the PostgreSQL INT8RANGE type.
@@ -119,9 +115,6 @@ class INT8RANGE(RangeOperators, sqltypes.TypeEngine):
__visit_name__ = "INT8RANGE"
-ischema_names["int8range"] = INT8RANGE
-
-
class NUMRANGE(RangeOperators, sqltypes.TypeEngine):
"""Represent the PostgreSQL NUMRANGE type.
@@ -130,9 +123,6 @@ class NUMRANGE(RangeOperators, sqltypes.TypeEngine):
__visit_name__ = "NUMRANGE"
-ischema_names["numrange"] = NUMRANGE
-
-
class DATERANGE(RangeOperators, sqltypes.TypeEngine):
"""Represent the PostgreSQL DATERANGE type.
@@ -141,9 +131,6 @@ class DATERANGE(RangeOperators, sqltypes.TypeEngine):
__visit_name__ = "DATERANGE"
-ischema_names["daterange"] = DATERANGE
-
-
class TSRANGE(RangeOperators, sqltypes.TypeEngine):
"""Represent the PostgreSQL TSRANGE type.
@@ -152,15 +139,9 @@ class TSRANGE(RangeOperators, sqltypes.TypeEngine):
__visit_name__ = "TSRANGE"
-ischema_names["tsrange"] = TSRANGE
-
-
class TSTZRANGE(RangeOperators, sqltypes.TypeEngine):
"""Represent the PostgreSQL TSTZRANGE type.
"""
__visit_name__ = "TSTZRANGE"
-
-
-ischema_names["tstzrange"] = TSTZRANGE