diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-07 01:37:55 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-12-07 01:37:55 +0000 |
commit | 44abaa9e567e6c412a2ce499907c65d97aa865dc (patch) | |
tree | 220c93883b683dcbaf2791a4caf269320abca1d1 /lib/sqlalchemy/sql.py | |
parent | 478b0e15ed70ae109e76b696efe151b7acac036b (diff) | |
download | sqlalchemy-44abaa9e567e6c412a2ce499907c65d97aa865dc.tar.gz |
added rudimentary support for limit and offset (with the hack version in oracle)
fixed up order_by to support a list/scalar of columns or asc/desc
fixed up query.py unit test
Diffstat (limited to 'lib/sqlalchemy/sql.py')
-rw-r--r-- | lib/sqlalchemy/sql.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index 71cbacdac..10e8f3e74 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -552,7 +552,7 @@ class CompoundClause(ClauseList): f += c._get_from_objects() return f def hash_key(self): - return string.join([c.hash_key() for c in self.clauses], self.operator) + return string.join([c.hash_key() for c in self.clauses], self.operator or " ") class Function(ClauseList, CompareMixin): """describes a SQL function. extends ClauseList to provide comparison operators.""" @@ -948,7 +948,7 @@ class CompoundSelect(Selectable, TailClauseMixin): class Select(Selectable, TailClauseMixin): """finally, represents a SELECT statement, with appendable clauses, as well as the ability to execute itself and return a result set.""" - def __init__(self, columns=None, whereclause = None, from_obj = [], order_by = None, group_by=None, having=None, use_labels = False, distinct=False, engine = None): + def __init__(self, columns=None, whereclause = None, from_obj = [], order_by = None, group_by=None, having=None, use_labels = False, distinct=False, engine = None, limit=None, offset=None): self._columns = util.OrderedProperties() self._froms = util.OrderedDict() self.use_labels = use_labels @@ -958,6 +958,8 @@ class Select(Selectable, TailClauseMixin): self.having = None self._engine = engine self.rowid_column = None + self.limit = limit + self.offset = offset # indicates if this select statement is a subquery inside another query self.issubquery = False |