summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/context.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/orm/context.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/orm/context.py')
-rw-r--r--lib/sqlalchemy/orm/context.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index 55a6b4cd2..96725e55b 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -46,6 +46,7 @@ class QueryContext(object):
__slots__ = (
"compile_state",
"query",
+ "params",
"load_options",
"bind_arguments",
"execution_options",
@@ -83,6 +84,7 @@ class QueryContext(object):
self,
compile_state,
statement,
+ params,
session,
load_options,
execution_options=None,
@@ -96,6 +98,7 @@ class QueryContext(object):
self.session = session
self.loaders_require_buffering = False
self.loaders_require_uniquing = False
+ self.params = params
self.propagated_loader_options = {
o for o in statement._with_options if o.propagate_to_loaders
@@ -239,7 +242,13 @@ class ORMCompileState(CompileState):
@classmethod
def orm_setup_cursor_result(
- cls, session, statement, execution_options, bind_arguments, result
+ cls,
+ session,
+ statement,
+ params,
+ execution_options,
+ bind_arguments,
+ result,
):
execution_context = result.context
compile_state = execution_context.compiled.compile_state
@@ -256,6 +265,7 @@ class ORMCompileState(CompileState):
querycontext = QueryContext(
compile_state,
statement,
+ params,
session,
load_options,
execution_options,
@@ -711,7 +721,9 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
and "entity_namespace" in element._annotations
):
for elem in _select_iterables(
- element._annotations["entity_namespace"].columns
+ element._annotations[
+ "entity_namespace"
+ ]._all_column_expressions
):
yield elem
else: