diff options
author | Federico Caselli <cfederico87@gmail.com> | 2022-06-03 12:13:10 +0200 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2022-06-04 12:02:49 -0400 |
commit | 526e9bb6ae025d3b8032d6efc1deb1a0f4a3dae3 (patch) | |
tree | c0ccb7d6ca955af37ed618e890cf31157e0f3839 /lib/sqlalchemy/orm/context.py | |
parent | ad86d32f7fbd1c6deda8ff3bebe0595c0f2986cc (diff) | |
download | sqlalchemy-526e9bb6ae025d3b8032d6efc1deb1a0f4a3dae3.tar.gz |
Fixed orm not applying fetch
Fixed an issue where :meth:`_sql.GenerativeSelect.fetch` would be
ignored when executing a statement using the ORM.
Fixes: #8091
Change-Id: I6790c7272a71278e90de2529c8bc8ae89e54e288
Diffstat (limited to 'lib/sqlalchemy/orm/context.py')
-rw-r--r-- | lib/sqlalchemy/orm/context.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 |