Project

General

Profile

« Previous | Next » 

Revision 2179

sql.py: mk_select(): Support only some join columns being join_using

View differences:

sql.py
431 431
            right_col = table+'.'+esc_name_(right_col)
432 432
            sql_ = right_col+' '
433 433
            
434
            # Parse special values
434 435
            if left_col == None: left_col = (left_col,)
435 436
                # for None values, tuple is optional
437
            elif left_col == join_using: left_col = right_col
438
            
439
            # Create SQL
436 440
            if isinstance(left_col, tuple) and len(left_col) == 1:
437 441
                # col is literal value
438 442
                value, = left_col
......
448 452
            return sql_
449 453
        
450 454
        if reduce(operator.and_, (v == join_using for v in joins.itervalues())):
451
            # all cols w/ USING
455
            # all cols w/ USING, so can use simpler USING syntax
452 456
            query += ' USING ('+(', '.join(joins.iterkeys()))+')'
453 457
        else: query += ' ON '+(' AND '.join(map(join, joins.iteritems())))
454 458
        

Also available in: Unified diff