summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2018-11-07 11:21:39 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2018-11-10 20:55:57 -0500
commitd5c2db437e584af9f1224ce28e3cec3618b7d90e (patch)
tree84937c9980a87422ec03c21e802a9b6867b6f0db /lib/sqlalchemy/sql/compiler.py
parent1f13c8c833ebd96c09d1499b2504aa4950dca709 (diff)
downloadsqlalchemy-d5c2db437e584af9f1224ce28e3cec3618b7d90e.tar.gz
Modernize deferred callable for many-to-one comparison
Improved the behavior of a relationship-bound many-to-one object expression such that the retrieval of column values on the related object are now resilient against the object being detached from its parent :class:`.Session`, even if the attribute has been expired. New features within the :class:`.InstanceState` are used to memoize the last known value of a particular column attribute before its expired, so that the expression can still evaluate when the object is detached and expired at the same time. Error conditions are also improved using modern attribute state features to produce more specific messages as needed. To support the value being mutated while also being resilient towards expiration, a new feature to InstanceState is added ._last_known_values which holds onto the expired value when an individual key is expired. Only takes effect specific to keys and InstanceState objects that received a special instruction so this does not add to overall memory/latency. Fixes: #4359 Change-Id: Iff272e667bf741074549db550bf65348553ca8e7
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
0 files changed, 0 insertions, 0 deletions