]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
restore parameter escaping for public methods
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Jun 2022 01:35:02 +0000 (21:35 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 9 Jun 2022 14:14:13 +0000 (10:14 -0400)
commitab8b4f25eebfbd2ef5819ff98dd372d5392c4b6b
tree4da3898d55d68333938396ba5f5ba8ed04e73791
parentd93f952b46c9cca557774d69442a7124c3309a2d
restore parameter escaping for public methods

Adjusted the fix made for :ticket:`8056` which adjusted the escaping of
bound parameter names with special characters such that the escaped names
were translated after the SQL compilation step, which broke a published
recipe on the FAQ illustrating how to merge parameter names into the string
output of a compiled SQL string. The change restores the escaped names that
come from ``compiled.params`` and adds a conditional parameter to
:meth:`.SQLCompiler.construct_params` named ``escape_names`` that defaults
to ``True``, restoring the old behavior by default.

Fixes: #8113
Change-Id: I9cbedb1080bc06d51f287fd2cbf26aaab1c74653
doc/build/changelog/unreleased_14/8113.rst [new file with mode: 0644]
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/compiler.py
test/sql/test_compiler.py