]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
apply criteria options from top-level core-only statement
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Apr 2023 17:46:12 +0000 (13:46 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 17 Apr 2023 19:32:00 +0000 (15:32 -0400)
commita05ae2c7ce0c056eef549d078faa2ca20356d35c
tree3927fa073a6b3b3b9d124ce953ed38c062ff1d28
parentacf7fbd60b9b1291dfc91438416867c88e94c5ba
apply criteria options from top-level core-only statement

Made an improvement to the :func:`_orm.with_loader_criteria` loader option
to allow it to be indicated in the :meth:`.Executable.options` method of a
top-level statement that is not itself an ORM statement. Examples include
:func:`_sql.select` that's embedded in compound statements such as
:func:`_sql.union`, within an :meth:`_dml.Insert.from_select` construct, as
well as within CTE expressions that are not ORM related at the top level.
Improved propagation of :func:`_orm.with_loader_criteria` within
ORM enabled UPDATE and DELETE statements as well.

Fixes: #9635
Change-Id: I088ad91929dc797c06f292f5dc547d48ffb30430
doc/build/changelog/unreleased_20/9635.rst [new file with mode: 0644]
lib/sqlalchemy/orm/bulk_persistence.py
lib/sqlalchemy/orm/context.py
test/orm/test_relationship_criteria.py