summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/dynamic.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-08-28 17:56:43 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-08-28 18:14:11 -0400
commit1e800285508ecd869c6874fed6f46ff68815d184 (patch)
tree681e28afe2a8fb8fa98226783b5dba43cbea75f5 /lib/sqlalchemy/orm/dynamic.py
parent1a745336d7e129233ead41bd18d83b543258bba6 (diff)
downloadsqlalchemy-1e800285508ecd869c6874fed6f46ff68815d184.tar.gz
See if the future is here
The docs are going to talk a lot about session.execute(select()) for ORM queries, and additionally it's much easier to help users with queries and such if we can use this new syntax. I'm hoping to see how hard it is to get a unified tutorial started that switches to new syntax. Basically, new syntax is much easier to explain and less buggy. But, if we are starting to present new syntax with the explicit goal of being easier to explain for less experienced programmers, the "future" thing is going to just be an impediment to that. See if we can remove "future" from session.execute(), so that ORM-enabled select() statements return ORM results at that level. This does not change the presence of the "future" flag for the Session's construction and for its transactional behaviors. The only perceptible change of the future flag for session.execute() is that session.execute(select()) where the statement has ORM entities in it now returns ORM new style tuples rather than old style tuples. Like mutating a URL, it's hopefully not very common that people are doing this. Change-Id: I0aa10322bb787d554d32772e3bc60548f1bf6206
Diffstat (limited to 'lib/sqlalchemy/orm/dynamic.py')
-rw-r--r--lib/sqlalchemy/orm/dynamic.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/dynamic.py b/lib/sqlalchemy/orm/dynamic.py
index 7832152a2..41d0fabd2 100644
--- a/lib/sqlalchemy/orm/dynamic.py
+++ b/lib/sqlalchemy/orm/dynamic.py
@@ -461,7 +461,7 @@ class AppenderQuery(Generative):
% (orm_util.instance_str(instance), self.attr.key)
)
- result = sess.execute(self._statement, future=True)
+ result = sess.execute(self._statement)
result = result.scalars()
if result._attributes.get("filtered", False):