From 465060104188876f192321a1d5bd33670aff9f5e 2013-08-13 10:50:39 From: Lance Edgar Date: 2013-08-13 10:50:39 Subject: [PATCH] Fixed boolean conditions in rendered SQL. --- diff --git a/sqlalchemy_pervasive/base.py b/sqlalchemy_pervasive/base.py index 78d265f38833cbe17d58b45e59dd481c4c63c844..85723bd117773b25555eb575e831eb5d9d217cae 100644 --- a/sqlalchemy_pervasive/base.py +++ b/sqlalchemy_pervasive/base.py @@ -36,19 +36,24 @@ class PervasiveCompiler(SQLCompiler): Custom SQL statement compiler for Pervasive PSQL. """ - # This logic was basically copied from the ``sqlalchemy-access`` dialect. - def get_select_precolumns(self, select): + # This logic was copied from the ``sqlalchemy-access`` dialect. s = 'DISTINCT ' if select._distinct else '' if select._limit: s += 'TOP {0} '.format(select._limit) if select._offset: raise InvalidRequestError( - "Pervasive PSQL does not support TOP (limit) with an offset") + "Pervasive PSQL does not support limit with an offset") return s def limit_clause(self, select): - return "" + return '' + + def visit_true(self, expr, **kw): + return '1' + + def visit_false(self, expr, **kw): + return '0' class PervasiveDialect(DefaultDialect):