]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
add explicit support for aliased ORM models in UPDATE/DELETE
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 25 Aug 2023 16:12:06 +0000 (12:12 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Aug 2023 17:15:53 +0000 (13:15 -0400)
commitd18ccdc997185b74e1506072805dcb71fde5fe07
tree5c8a81e1562f92c107179c320968de357d04fac6
parent7cf836241aa72494b42b645a3ddec04b0a6e6061
add explicit support for aliased ORM models in UPDATE/DELETE

Adjusted the ORM's interpretation of UPDATE/DELETE targets to not interfere
with the target table passed to the statement, such as for
:class:`_orm.aliased` constructs.   Cases like ORM session synchonize using
"SELECT" statements such as with MySQL/ MariaDB will still have issues with
UPDATE/DELETE of this form so it's best to disable synchonize_session when
using DML statements of this type.

A separate issue to identify RETURNING should be used for
ORM UPDATE of an aliased() with fetch strategy and that these columns
should come back was attempted here, but is failing tests and is beyond
the scope of the immediate issue.

also updates the mssql URL in config to suit current preferences :)

Change-Id: If1609ad500abb10d430717786142fb430d1c9265
doc/build/changelog/unreleased_20/10279.rst [new file with mode: 0644]
lib/sqlalchemy/orm/bulk_persistence.py
lib/sqlalchemy/sql/crud.py
setup.cfg
test/orm/dml/test_update_delete_where.py
test/orm/test_core_compilation.py
test/requirements.py