From aaec1bdedfc73ead3aef3a3e4d835a8df339e2dd Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sun, 19 Apr 2020 20:09:39 +0200 Subject: 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 --- lib/sqlalchemy/dialects/postgresql/json.py | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'lib/sqlalchemy/dialects/postgresql/json.py') diff --git a/lib/sqlalchemy/dialects/postgresql/json.py b/lib/sqlalchemy/dialects/postgresql/json.py index 953ad9993..ea7b04d4f 100644 --- a/lib/sqlalchemy/dialects/postgresql/json.py +++ b/lib/sqlalchemy/dialects/postgresql/json.py @@ -6,8 +6,6 @@ # the MIT License: http://www.opensource.org/licenses/mit-license.php from __future__ import absolute_import -from .base import colspecs -from .base import ischema_names from ... import types as sqltypes from ... import util from ...sql import operators @@ -96,9 +94,6 @@ class JSONPathType(sqltypes.JSON.JSONPathType): return process -colspecs[sqltypes.JSON.JSONPathType] = JSONPathType - - class JSON(sqltypes.JSON): """Represent the PostgreSQL JSON type. @@ -236,10 +231,6 @@ class JSON(sqltypes.JSON): comparator_factory = Comparator -colspecs[sqltypes.JSON] = JSON -ischema_names["json"] = JSON - - class JSONB(JSON): """Represent the PostgreSQL JSONB type. @@ -324,6 +315,3 @@ class JSONB(JSON): ) comparator_factory = Comparator - - -ischema_names["jsonb"] = JSONB -- cgit v1.2.1