Project

General

Profile

« Previous | Next » 

Revision 3027

sql.py: mk_select(): Put '*' on same line as 'SELECT' if there is no DISTINCT ON, to avoid extra newlines

View differences:

lib/sql.py
571 571
            query += ' ON ('+(', '.join(map(parse_col, distinct_on)))+')'
572 572
    
573 573
    # Columns
574
    query += '\n'
575
    if fields == None: query += '*'
574
    if fields == None:
575
        if query.find('\n') >= 0: whitespace = '\n'
576
        else: whitespace = ' '
577
        query += whitespace+'*'
576 578
    else:
577 579
        assert fields != []
578
        query += '\n, '.join(map(parse_col, fields))
580
        query += '\n'+('\n, '.join(map(parse_col, fields)))
579 581
    
580 582
    # Main table
581 583
    query += '\nFROM '+table0.to_str(db)

Also available in: Unified diff