Project

General

Profile

« Previous | Next » 

Revision 2467

sql.py, sql_gen.py: Reformatted generated SQL for presentability by adding newlines

View differences:

sql_gen.py
69 69
        self.cols = cols
70 70
    
71 71
    def to_str(self, db):
72
        str_ = self.code.to_str(db)+' AS '+Table.to_str(self, db)
72
        str_ = self.code.to_str(db)+'\nAS '+Table.to_str(self, db)
73 73
        if self.cols != None: str_ += ' ('+(', '.join(self.cols))+')'
74 74
        return str_
75 75
    
......
258 258
            # all cols w/ USING, so can use simpler USING syntax
259 259
            cols = (as_Col(v).to_str(db) for v in joins.iterkeys())
260 260
            join_cond = 'USING ('+(', '.join(cols))+')'
261
        else: join_cond = 'ON '+(' AND '.join(map(join, joins.iteritems())))
261
        else: join_cond = 'ON\n'+('\nAND\n'.join(map(join, joins.iteritems())))
262 262
        
263 263
        # Create join
264 264
        if type_ is filter_out: type_ = 'LEFT'

Also available in: Unified diff