diff --git a/torba/basedatabase.py b/torba/basedatabase.py index ae2f48ce8..674b10ebc 100644 --- a/torba/basedatabase.py +++ b/torba/basedatabase.py @@ -84,12 +84,12 @@ def query(select, **constraints): else: raise ValueError("order_by must be string or list") - if offset is not None: - sql.append('OFFSET {}'.format(offset)) - if limit is not None: sql.append('LIMIT {}'.format(limit)) + if offset is not None: + sql.append('OFFSET {}'.format(offset)) + return ' '.join(sql), values