]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
support JSONB subscripting syntax
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 11 Jul 2025 16:51:44 +0000 (12:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 13 Jul 2025 15:58:48 +0000 (11:58 -0400)
commit2ac0c459669d0200a4d15162ffc0a8765c60cb07
tree910fd69b906f21fdc047c5ef73f572f0da38d41b
parent66d894f2651d781844c4c3cd92fbdcaf4c3aac15
support JSONB subscripting syntax

Added support for PostgreSQL 14+ JSONB subscripting syntax. When connected
to PostgreSQL 14 or later, JSONB columns now automatically use the native
subscript notation ``jsonb_col['key']`` instead of the arrow operator
``jsonb_col -> 'key'`` for both read and write operations. This provides
better compatibility with PostgreSQL's native JSONB subscripting feature
while maintaining backward compatibility with older PostgreSQL versions.
JSON columns continue to use the traditional arrow syntax regardless of
PostgreSQL version.

Fixes: #10927
Change-Id: I4b3a8a55a71f2ca3d95416a7b350b785574631eb
doc/build/changelog/unreleased_20/10927.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_compiler.py
test/dialect/postgresql/test_query.py
test/dialect/postgresql/test_types.py