diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-11 10:34:44 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-11 11:46:48 -0500 |
commit | c46279d1c215b7af956e40cb29afafba29d9143f (patch) | |
tree | db93eef98b764a522dce45329b1565928ba2b903 /lib/sqlalchemy/sql/base.py | |
parent | a15aeba4fb22503c1eb235fdc2e7a574136ca7dc (diff) | |
download | sqlalchemy-c46279d1c215b7af956e40cb29afafba29d9143f.tar.gz |
Revise attribute refresh for with_loader_criteria, related
Added new attribute :attr:`_orm.ORMExecuteState.is_column_load` to indicate
that a :meth:`_orm.SessionEvents.do_orm_execute` handler that a particular
operation is a primary-key-directed column attribute load, such as from an
expiration or a deferred attribute, and that WHERE criteria or additional
loader options should not be added to the query. This has been added to
the examples which illustrate the :func:`_orm.with_loader_criteria` option.
The :func:`_orm.with_loader_criteria` option has been modified so that it
will never apply its criteria to the SELECT statement for an ORM refresh
operation, such as that invoked by :meth:`_orm.Session.refresh` or whenever
an expired attribute is loaded. These queries are only against the
primary key row of the object that is already present in memory so there
should not be additional criteria added.
Added doc caveats for using lambdas.
Added test coverage for most ORMExecuteState flags and fixed a few
basic access issues.
Change-Id: I6707e4cf0dc95cdfb8ce93e5ca22ead86074baa7
References: #5760
Fixes: #5761
Fixes: #5762
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
0 files changed, 0 insertions, 0 deletions