diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-10-25 11:34:37 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-10-26 18:16:02 -0400 |
commit | d6db28556b095dc85fff3e0e09b0e70358a9538b (patch) | |
tree | b74991aeeebcf8ab666816049d3aae17d566abdb /lib/sqlalchemy/sql/compiler.py | |
parent | 172d99a8a1282b534aeadafebdd2af0162758931 (diff) | |
download | sqlalchemy-d6db28556b095dc85fff3e0e09b0e70358a9538b.tar.gz |
Don't cache a query that has before_compile modifications
The :class:`.BakedQuery` will not cache a query that was modified by a
:meth:`.QueryEvents.before_compile` event, so that compilation hooks that
may be applying ad-hoc modifications to queries will take effect on each
run. In particular this is helpful for events that modify queries used in
lazy loading as well as eager loading such as "select in" loading. In
order to re-enable caching for a query modified by this event, a new
flag ``bake_ok`` is added; see :ref:`baked_with_before_compile` for
details.
A longer term plan to provide a new form of SQL caching should solve this
kind of issue more comprehensively.
Fixes: #4947
Change-Id: I5823c4fa00e7b6d46a2e8461b02d8b16605a6ed0
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
0 files changed, 0 insertions, 0 deletions