]> 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 13:58:11 +0000 (09:58 -0400)
commit370d73b4e4b3009ea5feed1341ead965f6aa98bb
treed86d23568f0edc9b2c67210073c83bca99eaca7e
parent6e8c390c1b937d842893646fb59785eaa48b243b
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
doc/build/changelog/unreleased_14/8210.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
test/orm/test_update_delete.py
test/sql/test_insert_exec.py