From c60e17b34172e482c8e96a7cbe7cb1db687799e3 Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Tue, 9 Oct 2018 14:44:26 -0400 Subject: [PATCH] fix LIMIT OFFSET syntax error --- torba/basedatabase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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