]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add TString support
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Nov 2025 18:11:24 +0000 (13:11 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 30 Nov 2025 19:38:13 +0000 (14:38 -0500)
commitb9e3cacb0e7025a31458f09d0cb0c72da0c5f660
tree17c999d64b7e7e3e4ef7d1c49d93b02befa8942d
parent6dbd980df0d2f4d69db7fe1c13c1d6be17bacd67
add TString support

Added support for Python 3.14+ template strings (t-strings) via the new
:func:`_sql.tstring` construct, as defined in :pep:`750`. This feature
allows for ergonomic SQL statement construction by automatically
interpolating Python values and SQLAlchemy expressions within template
strings.

Part of the challenge here is the syntax only works on py314, so we have
to exclude the test file at many levels when py314 is not used.  not
sure yet how i want to adjust pep8 tests and rules for this.

Fixes: #12548
Change-Id: Ia060d1387ff452fe4f5d924f683529a22a8e1f72
28 files changed:
.pre-commit-config.yaml
doc/build/changelog/migration_21.rst
doc/build/changelog/unreleased_21/12548.rst [new file with mode: 0644]
doc/build/core/sqlelement.rst
lib/sqlalchemy/__init__.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/_elements_constructors.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/util/compat.py
noxfile.py
pyproject.toml
test/conftest.py
test/orm/test_query.py
test/orm/test_text.py [new file with mode: 0644]
test/orm/test_tstring_py314.py [new file with mode: 0644]
test/profiles.txt
test/sql/test_compare.py
test/sql/test_statement_params.py
test/sql/test_tstrings_py314.py [new file with mode: 0644]
test/typing/plain_files/orm/typed_queries.py