summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/compiler.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-08-05 17:58:48 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-08-05 18:53:17 -0400
commit71a3ccbdef0d88e9231b7de9c51e4ed60b3b7181 (patch)
tree3251bd2b54584f832f7c1f31283ddfb675df3495 /lib/sqlalchemy/sql/compiler.py
parentcc57ea495f6460dd56daa6de57e40047ed999369 (diff)
downloadsqlalchemy-71a3ccbdef0d88e9231b7de9c51e4ed60b3b7181.tar.gz
Convert lazy loader, selectinload, load_on_ident to lambda statements
Building on newly robust lambdas in I29a513c98917b1d503abfdd61e6b6e8800851aa8, convert key loading off of the "baked" system so that baked is no longer used by the ORM. Change-Id: I3abfb45dd6e50f84f29d39434caa0b550ce27864
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r--lib/sqlalchemy/sql/compiler.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index a8bd1de33..ac4055bdf 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -353,6 +353,7 @@ class FromLinter(collections.namedtuple("FromLinter", ["froms", "edges"])):
message = template.format(
froms=froms_str, start=self.froms[start_with]
)
+
util.warn(message)
@@ -713,7 +714,10 @@ class SQLCompiler(Compiled):
self.cache_key = cache_key
if cache_key:
- self._cache_key_bind_match = {b: b for b in cache_key[1]}
+ self._cache_key_bind_match = ckbm = {
+ b.key: b for b in cache_key[1]
+ }
+ ckbm.update({b: b for b in cache_key[1]})
# compile INSERT/UPDATE defaults/sequences to expect executemany
# style execution, which may mean no pre-execute of defaults,
@@ -2166,7 +2170,10 @@ class SQLCompiler(Compiled):
# key was been generated.
ckbm = self._cache_key_bind_match
if ckbm:
- ckbm.update({bp: bindparam for bp in bindparam._cloned_set})
+ for bp in bindparam._cloned_set:
+ if bp.key in ckbm:
+ cb = ckbm[bp.key]
+ ckbm[cb] = bindparam
if bindparam.isoutparam:
self.has_out_parameters = True
@@ -2186,6 +2193,7 @@ class SQLCompiler(Compiled):
expanding=bindparam.expanding,
**kwargs
)
+
if bindparam.expanding:
ret = "(%s)" % ret
return ret