]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support `ARRAY` of `Enum`, `JSON` or `JSONB`
authorFederico Caselli <cfederico87@gmail.com>
Sun, 19 Apr 2020 18:09:39 +0000 (20:09 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 20 Apr 2020 15:54:31 +0000 (11:54 -0400)
commit896da59aa43b0075cdf2561e56b6e29607be5db1
treeed04863eaace32e16f625a87fc56888d8a2a3ac2
parent242c987d8297fa7834c35c5bd4749d2a1b2524fe
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
(cherry picked from commit aaec1bdedfc73ead3aef3a3e4d835a8df339e2dd)
doc/build/changelog/unreleased_13/5265.rst [new file with mode: 0644]
doc/build/changelog/unreleased_13/5266.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/array.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/postgresql/hstore.py
lib/sqlalchemy/dialects/postgresql/json.py
lib/sqlalchemy/dialects/postgresql/ranges.py
test/dialect/postgresql/test_types.py