]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Implement relationship AND criteria; global loader criteria
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Aug 2020 01:47:43 +0000 (21:47 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 6 Aug 2020 02:13:11 +0000 (22:13 -0400)
commitc7b489b25802f7a25ef78d0731411295c611cc1c
treef5e3b66ab8eb8bb7398c0195fa2b2f1de8ab91c4
parent71a3ccbdef0d88e9231b7de9c51e4ed60b3b7181
Implement relationship AND criteria; global loader criteria

Added the ability to add arbitrary criteria to the ON clause generated
by a relationship attribute in a query, which applies to methods such
as :meth:`_query.Query.join` as well as loader options like
:func:`_orm.joinedload`.   Additionally, a "global" version of the option
allows limiting criteria to be applied to particular entities in
a query globally.

Documentation is minimal at this point, new examples will
be coming in a subsequent commit.

Some adjustments to execution options in how they are represented
in the ORMExecuteState as well as well as a few ORM tests that
forgot to get merged in a preceding commit.

Fixes: #4472
Change-Id: I2b8fc57092dedf35ebd16f6343ad0f0d7d332beb
23 files changed:
doc/build/changelog/unreleased_14/4472.rst [new file with mode: 0644]
doc/build/orm/loading_relationships.rst
doc/build/orm/query.rst
lib/sqlalchemy/ext/horizontal_shard.py
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/interfaces.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/relationships.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/strategy_options.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/compiler.py
test/ext/test_baked.py
test/orm/inheritance/test_polymorphic_rel.py
test/orm/test_bundle.py
test/orm/test_cache_key.py
test/orm/test_events.py
test/orm/test_options.py
test/orm/test_relationship_criteria.py [new file with mode: 0644]
test/sql/test_compare.py