summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/visitors.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-11-03 23:17:34 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-11-03 23:17:34 +0000
commit8ebc8ee5bae0f4bef465e8b5b4b46609cfdebc10 (patch)
treec27fc44d024fa066c6ea8af752305ccb506e7019 /lib/sqlalchemy/sql/visitors.py
parent0af3f8f35b5e46f749d328e6fae90f6ff4915e97 (diff)
downloadsqlalchemy-8ebc8ee5bae0f4bef465e8b5b4b46609cfdebc10.tar.gz
- eager loading with LIMIT/OFFSET applied no longer adds the primary
table joined to a limited subquery of itself; the eager loads now join directly to the subquery which also provides the primary table's columns to the result set. This eliminates a JOIN from all eager loads with LIMIT/OFFSET. [ticket:843]
Diffstat (limited to 'lib/sqlalchemy/sql/visitors.py')
-rw-r--r--lib/sqlalchemy/sql/visitors.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sqlalchemy/sql/visitors.py b/lib/sqlalchemy/sql/visitors.py
index bf15c2b7e..9bc5d2479 100644
--- a/lib/sqlalchemy/sql/visitors.py
+++ b/lib/sqlalchemy/sql/visitors.py
@@ -29,6 +29,14 @@ class ClauseVisitor(object):
if meth:
return meth(obj, **kwargs)
+ def traverse_chained(self, obj, **kwargs):
+ v = self
+ while v is not None:
+ meth = getattr(self, "visit_%s" % obj.__visit_name__, None)
+ if meth:
+ meth(obj, **kwargs)
+ v = getattr(v, '_next', None)
+
def iterate(self, obj, stop_on=None):
stack = [obj]
traversal = []