]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
introduce deferred lambdas
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 16 Dec 2019 22:06:43 +0000 (17:06 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 Jul 2020 03:39:51 +0000 (23:39 -0400)
commit3dc9a4a2392d033f9d1bd79dd6b6ecea6281a61c
tree1041bccb37422f526dccb5b1e57ffad1c702549b
parent5060043e8e95ab0aab5f63ed288c1426c46da66e
introduce deferred lambdas

The coercions system allows us to add in lambdas as arguments
to Core and ORM elements without changing them at all.   By allowing
the lambda to produce a deterministic cache key where we can also
cheat and yank out literal parameters means we can move towards
having 90% of "baked" functionality in a clearer way right in
Core / ORM.

As a second step, we can have whole statements inside the lambda,
and can then add generation with __add__(), so then we have
100% of "baked" functionality with full support of ad-hoc
literal values.

Adds some more short_selects tests for the moment for comparison.

Other tweaks inside cache key generation as we're trying to
approach a certain level of performance such that we can
remove the use of "baked" from the loader strategies.

As we have not yet closed #4639, however the caching feature
has been fully integrated as of
b0cfa7379cf8513a821a3dbe3028c4965d9f85bd, we will also
add complete caching documentation here and close that issue
as well.

Closes: #4639
Fixes: #5380
Change-Id: If91f61527236fd4d7ae3cad1f24c38be921c90ba
36 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/unreleased_14/4639.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/5380.rst [new file with mode: 0644]
doc/build/core/connections.rst
doc/build/core/sqlelement.rst
doc/build/faq/performance.rst
doc/build/orm/extensions/baked.rst
examples/performance/short_selects.py
lib/sqlalchemy/__init__.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/create.py
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/future/selectable.py
lib/sqlalchemy/orm/attributes.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/lambdas.py [new file with mode: 0644]
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
test/base/test_result.py
test/ext/test_baked.py
test/orm/test_cache_key.py
test/orm/test_lambdas.py [new file with mode: 0644]
test/profiles.txt
test/sql/test_compare.py
test/sql/test_lambdas.py [new file with mode: 0644]