summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2022-06-04 18:21:02 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2022-06-04 18:21:02 +0000
commitcdafd5bb865e867660238b61e727d33ef6f42b37 (patch)
treec48bf521f25ddeddd69f962086e16d31b4c1dc23 /lib/sqlalchemy
parent8131ef51ef2507238e9e9a32bc1cbec19dd3a600 (diff)
parent526e9bb6ae025d3b8032d6efc1deb1a0f4a3dae3 (diff)
downloadsqlalchemy-cdafd5bb865e867660238b61e727d33ef6f42b37.tar.gz
Merge "Fixed orm not applying fetch" into main
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/sqlite/aiosqlite.py1
-rw-r--r--lib/sqlalchemy/orm/context.py8
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py
index a5a1ec065..93c1a499d 100644
--- a/lib/sqlalchemy/dialects/sqlite/aiosqlite.py
+++ b/lib/sqlalchemy/dialects/sqlite/aiosqlite.py
@@ -212,7 +212,6 @@ class AsyncAdapt_aiosqlite_connection(AdaptedConnection):
self._handle_exception(error)
def close(self):
- # print(">close", self)
try:
self.await_(self._connection.close())
except Exception as error:
diff --git a/lib/sqlalchemy/orm/context.py b/lib/sqlalchemy/orm/context.py
index 58556bb58..8676f828e 100644
--- a/lib/sqlalchemy/orm/context.py
+++ b/lib/sqlalchemy/orm/context.py
@@ -1338,6 +1338,8 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
correlate_except,
limit_clause,
offset_clause,
+ fetch_clause,
+ fetch_clause_options,
distinct,
distinct_on,
prefixes,
@@ -1369,6 +1371,8 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
statement._limit_clause = limit_clause
statement._offset_clause = offset_clause
+ statement._fetch_clause = fetch_clause
+ statement._fetch_clause_options = fetch_clause_options
if prefixes:
statement._prefixes = prefixes
@@ -2037,6 +2041,10 @@ class ORMSelectCompileState(ORMCompileState, SelectState):
"prefixes": self.select_statement._prefixes,
"suffixes": self.select_statement._suffixes,
"group_by": self.group_by or None,
+ "fetch_clause": self.select_statement._fetch_clause,
+ "fetch_clause_options": (
+ self.select_statement._fetch_clause_options
+ ),
}
@property