]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Robustness for lambdas, lambda statements
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Aug 2020 20:42:26 +0000 (16:42 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 5 Aug 2020 20:42:26 +0000 (16:42 -0400)
commitcc57ea495f6460dd56daa6de57e40047ed999369
tree837f5a84363c387d7f8fdeabc06928cd078028e1
parent2a946254023135eddd222974cf300ffaa5583f02
Robustness for lambdas, lambda statements

in order to accommodate relationship loaders
with lambda caching, a lot more is needed.  This is
a full refactor of the lambda system such that it
now has two levels of caching; the first level caches what
can be known from the __code__ element, then the next level
of caching is against the lambda itself and the contents
of __closure__.  This allows for the elements inside
the lambdas, like columns and entities, to change and
then be part of the cache key.  Lazy/selectinloads' use of
baked queries had to add distinct cache key elements,
which was attempted here but overall things needed to be
more robust than that.

This commit is broken out from the very long and sprawling
commit at Id6b5c03b1ce9ddb7b280f66792212a0ef0a1c541 .

Change-Id: I29a513c98917b1d503abfdd61e6b6e8800851aa8
15 files changed:
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/engine/cursor.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_collections.py
test/sql/test_compare.py
test/sql/test_external_traversal.py
test/sql/test_lambdas.py
test/sql/test_selectable.py