summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mssql
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-02-08 11:58:15 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-02-08 13:14:52 -0500
commitc0521e6f0688b794048e44ff3df429249a093b72 (patch)
treed509123bb03c6e938952c4eb6444fd00d5edbc67 /lib/sqlalchemy/dialects/mssql
parent80010c63149be411e89c7434a9d52096f9de56b8 (diff)
downloadsqlalchemy-c0521e6f0688b794048e44ff3df429249a093b72.tar.gz
Add identifier_preparer per-execution context for schema translates
Fixed bug where the "schema_translate_map" feature failed to be taken into account for the use case of direct execution of :class:`_schema.DefaultGenerator` objects such as sequences, which included the case where they were "pre-executed" in order to generate primary key values when implicit_returning was disabled. Fixes: #5929 Change-Id: I3fed1d0af28be5ce9c9bb572524dcc8411633f60
Diffstat (limited to 'lib/sqlalchemy/dialects/mssql')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index 9d0e5d322..674d54179 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -17,7 +17,7 @@ External Dialects
In addition to the above DBAPI layers with native SQLAlchemy support, there
are third-party dialects for other DBAPI layers that are compatible
with SQL Server. See the "External Dialects" list on the
-:ref:`dialect_toplevel` page.
+:ref:`dialect_toplevel` page.
.. _mssql_identity:
@@ -1560,7 +1560,7 @@ class MSExecutionContext(default.DefaultExecutionContext):
self.cursor,
self._opt_encode(
"SET IDENTITY_INSERT %s ON"
- % self.dialect.identifier_preparer.format_table(tbl)
+ % self.identifier_preparer.format_table(tbl)
),
(),
self,
@@ -1606,7 +1606,7 @@ class MSExecutionContext(default.DefaultExecutionContext):
self.cursor,
self._opt_encode(
"SET IDENTITY_INSERT %s OFF"
- % self.dialect.identifier_preparer.format_table(
+ % self.identifier_preparer.format_table(
self.compiled.statement.table
)
),
@@ -1630,7 +1630,7 @@ class MSExecutionContext(default.DefaultExecutionContext):
self.cursor.execute(
self._opt_encode(
"SET IDENTITY_INSERT %s OFF"
- % self.dialect.identifier_preparer.format_table(
+ % self.identifier_preparer.format_table(
self.compiled.statement.table
)
)
@@ -1650,7 +1650,7 @@ class MSExecutionContext(default.DefaultExecutionContext):
return self._execute_scalar(
(
"SELECT NEXT VALUE FOR %s"
- % self.dialect.identifier_preparer.format_sequence(seq)
+ % self.identifier_preparer.format_sequence(seq)
),
type_,
)