]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
support parameters in all ORM insert modes
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 1 Apr 2023 15:56:56 +0000 (11:56 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Apr 2023 19:45:04 +0000 (15:45 -0400)
commit8ec396873c9bbfcc4416e55b5f9d8653554a1df0
tree562d185c64995b99b6c854b337f64d48f692b495
parent32a17e60ba63f0278a754e1ab7e9ebf9460e07c5
support parameters in all ORM insert modes

Fixed 2.0 regression where use of :func:`_sql.bindparam()` inside of
:meth:`_dml.Insert.values` would fail to be interpreted correctly when
executing the :class:`_dml.Insert` statement using the ORM
:class:`_orm.Session`, due to the new ORM-enabled insert feature not
implementing this use case.

In addition, the bulk INSERT and UPDATE features now add these
capabilities:

* The requirement that extra parameters aren't passed when using ORM
INSERT using the "orm" dml_strategy setting is lifted.
* The requirement that additional WHERE criteria is not passed when using
ORM UPDATE using the "bulk" dml_strategy setting is lifted.  Note that
in this case, the check for expected row count is turned off.

Fixes: #9583
Change-Id: I539c18893b697caeab5a5f0195a27d4f0487e728
doc/build/changelog/unreleased_20/9583.rst [new file with mode: 0644]
lib/sqlalchemy/orm/bulk_persistence.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/sql/elements.py
test/orm/dml/test_bulk_statements.py
test/orm/dml/test_update_delete_where.py
test/sql/test_utils.py