]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
generalize sql server check for id col to accommodate ORM cases
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Jul 2022 01:05:18 +0000 (21:05 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 6 Jul 2022 02:02:43 +0000 (22:02 -0400)
commit844365266aeb2582d775d019c48e7ffa6113c673
tree3223c0c65ef76fa4d892c468a47df4f0269023bf
parentd0308de0b67802b9e2e3faa8309d861545e38f86
generalize sql server check for id col to accommodate ORM cases

Fixed issues that prevented the new usage patterns for using DML with ORM
objects presented at :ref:`orm_dml_returning_objects` from working
correctly with the SQL Server pyodbc dialect.

Here we add a step to look in compile_state._dict_values more thoroughly
for the keys we need to determine "identity insert" or not, and also
add a new compiler variable dml_compile_state so that we can skip the
ORM's compile_state if present.

Fixes: #8210
Change-Id: Idbd76bb3eb075c647dc6c1cb78f7315c821e15f7
(cherry picked from commit 5806428800d2f1ac775156f90497a2fc3a644f35)
doc/build/changelog/unreleased_14/8210.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
test/orm/test_update_delete.py
test/sql/test_insert_exec.py