]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
simplify and publicize the asyncpg JSON(B) codec registrsation
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 3 Nov 2021 15:32:51 +0000 (11:32 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 4 Nov 2021 14:44:25 +0000 (10:44 -0400)
commit482fe81f65c14f93e03d4d300c4797658d5c76db
tree504ffc67b8bb4016f205b63197f82ffc3a53bcb1
parenteb6bddb160fd8ba1cf87b6c4548ec9a29c34c279
simplify and publicize the asyncpg JSON(B) codec registrsation

Added overridable methods ``PGDialect_asyncpg.setup_asyncpg_json_codec``
and ``PGDialect_asyncpg.setup_asyncpg_jsonb_codec`` codec, which handle the
required task of registering JSON/JSONB codecs for these datatypes when
using asyncpg. The change is that methods are broken out as individual,
overridable methods to support third party dialects that need to alter or
disable how these particular codecs are set up.

Fixes: #7284
Change-Id: I3eac258fea61f3975bd03c428747f788813ce45e
(cherry picked from commit 8bd8f6c5aa1e85907b1517a57a91997532f3ebd7)
doc/build/changelog/unreleased_14/7284.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/asyncpg.py
test/dialect/postgresql/test_async_pg_py3k.py