]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
syntax extensions (patch 1)
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Dec 2024 22:29:22 +0000 (17:29 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Mar 2025 21:03:16 +0000 (16:03 -0500)
commit8be3b096a6c6adc3e51b0b23d02568c9e6728253
tree3635dabb253722562a3d31c238ccbd37d46fc28e
parent9b9e1e127f77618e84dee233b3d4beaae1f4e50d
syntax extensions (patch 1)

Added the ability to create custom SQL constructs that can define new
clauses within SELECT, INSERT, UPDATE, and DELETE statements without
needing to modify the construction or compilation code of of
:class:`.Select`, :class:`.Insert`, :class:`.Update`, or :class:`.Delete`
directly.  Support for testing these constructs, including caching support,
is present along with an example test suite.  The use case for these
constructs is expected to be third party dialects for NewSQL or other novel
styles of database that introduce new clauses to these statements.   A new
example suite is included which illustrates the ``QUALIFY`` SQL construct
used by several NewSQL databases which includes a cachable implementation
as well as a test suite.

Since these extensions start to make it a bit crowded with how many
kinds of "options" we have on statements, did some naming /
documentation changes with existing constructs on Executable, in
particular to distinguish ExecutableOption from SyntaxExtension.

Fixes: #12195
Change-Id: I4a44ee5bbc3d8b1b640837680c09d25b1b7077af
26 files changed:
doc/build/changelog/unreleased_21/12195.rst [new file with mode: 0644]
doc/build/core/compiler.rst
doc/build/orm/examples.rst
examples/syntax_extensions/__init__.py [new file with mode: 0644]
examples/syntax_extensions/qualify.py [new file with mode: 0644]
examples/syntax_extensions/test_qualify.py [new file with mode: 0644]
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/cache_key.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/testing/fixtures/__init__.py
lib/sqlalchemy/testing/fixtures/sql.py
test/base/test_examples.py
test/orm/test_syntax_extensions.py [new file with mode: 0644]
test/sql/test_compare.py
test/sql/test_syntax_extensions.py [new file with mode: 0644]