]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
ensure primary key values all present for ORM bulk UPDATE
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 8 Jun 2023 21:40:01 +0000 (17:40 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 9 Jun 2023 14:14:54 +0000 (10:14 -0400)
commit2f62fb12ea44d552bf95903c7d82f6952cdbf026
tree8c61303c8cb1e74d23cb2fb6506107078d95f002
parent693b8744ee45ebb65bfcbb9156935ffb2a3ee9ad
ensure primary key values all present for ORM bulk UPDATE

Fixed bug in new feature where ORM bulk UPDATE can be combined with a WHERE
clause, added in version 2.0.11 as part of :ticket:`9583`, where sending
dictionaries that did not include the primary key values for each row would
run through the bulk process and include "pk=NULL" for the rows, silently
failing.   An exception is now raised if primary key values for bulk UPDATE
are not supplied.

Additionally, document WHERE criteria feature as well as how to
invoke an UPDATE outside of "bulk orm by primary key"

Fixes: #9917
Change-Id: Ie8e0d604050f0dfbab77473020771383c087d14a
doc/build/changelog/unreleased_20/9917.rst [new file with mode: 0644]
doc/build/errors.rst
doc/build/orm/queryguide/dml.rst
lib/sqlalchemy/orm/persistence.py
test/orm/dml/test_bulk_statements.py