]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Convert schema_translate to a post compile
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 23 Mar 2020 18:52:05 +0000 (14:52 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 24 Mar 2020 18:25:41 +0000 (14:25 -0400)
commitcadfc608d63f4e0df46c0daaa28902423fd88d71
tree63b05c466c5c0cbebae5515d7790291305e66cc6
parentfd74bd8eea3f3696c43ca0336ed4e437036c43c5
Convert schema_translate to a post compile

Revised the :paramref:`.Connection.execution_options.schema_translate_map`
feature such that the processing of the SQL statement to receive a specific
schema name occurs within the execution phase of the statement, rather than
at the compile phase.   This is to support the statement being efficiently
cached.   Previously, the current schema being rendered into the statement
for a particular run would be considered as part of the cache key itself,
meaning that for a run against hundreds of schemas, there would be hundreds
of cache keys, rendering the cache much less performant.  The new behavior
is that the rendering is done in a similar  manner as the "post compile"
rendering added in 1.4 as part of :ticket:`4645`, :ticket:`4808`.

Fixes: #5004
Change-Id: Ia5c89eb27cc8dc2c5b8e76d6c07c46290a7901b6
17 files changed:
doc/build/changelog/unreleased_14/5004.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/mock.py
lib/sqlalchemy/engine/reflection.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/testing/assertions.py
lib/sqlalchemy/testing/assertsql.py
lib/sqlalchemy/testing/suite/test_reflection.py
test/dialect/postgresql/test_compiler.py
test/engine/test_execute.py
test/sql/test_compiler.py
test/sql/test_ddlemit.py