Changeset - 465060104188
[Not reviewed]
0 1 0
Lance Edgar (lance) - 11 years ago 2013-08-13 10:50:39
lance@edbob.org
Fixed boolean conditions in rendered SQL.
1 file changed with 9 insertions and 4 deletions:
0 comments (0 inline, 0 general)
sqlalchemy_pervasive/base.py
Show inline comments
 
@@ -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):
0 comments (0 inline, 0 general)