Skip to content

Commit 4650601

Browse files
committed
Fixed boolean conditions in rendered SQL.
1 parent b48e6cb commit 4650601

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

sqlalchemy_pervasive/base.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,24 @@ class PervasiveCompiler(SQLCompiler):
3636
Custom SQL statement compiler for Pervasive PSQL.
3737
"""
3838

39-
# This logic was basically copied from the ``sqlalchemy-access`` dialect.
40-
4139
def get_select_precolumns(self, select):
40+
# This logic was copied from the ``sqlalchemy-access`` dialect.
4241
s = 'DISTINCT ' if select._distinct else ''
4342
if select._limit:
4443
s += 'TOP {0} '.format(select._limit)
4544
if select._offset:
4645
raise InvalidRequestError(
47-
"Pervasive PSQL does not support TOP (limit) with an offset")
46+
"Pervasive PSQL does not support limit with an offset")
4847
return s
4948

5049
def limit_clause(self, select):
51-
return ""
50+
return ''
51+
52+
def visit_true(self, expr, **kw):
53+
return '1'
54+
55+
def visit_false(self, expr, **kw):
56+
return '0'
5257

5358

5459
class PervasiveDialect(DefaultDialect):

0 commit comments

Comments
 (0)