Project

General

Profile

« Previous | Next » 

Revision 2641

sql_gen.py: ColDict: Take a keys_table param for operations that require the output table. Use this to convert all string keys to sql_gen.Col objects.

View differences:

sql.py
859 859
    '''Recovers from errors.
860 860
    Only works under PostgreSQL (uses INSERT RETURNING).
861 861
    '''
862
    row = sql_gen.ColDict(row)
862
    row = sql_gen.ColDict(table, row)
863 863
    if pkey_ == None: pkey_ = pkey(db, table, recover=True)
864 864
    
865 865
    try:
......
922 922
    @return sql_gen.Col Where the output pkeys are made available
923 923
    '''
924 924
    out_table = sql_gen.as_Table(out_table)
925
    mapping = sql_gen.ColDict(mapping)
925
    mapping = sql_gen.ColDict(out_table, mapping)
926 926
    
927 927
    def log_debug(msg): db.log_debug(msg, level=1.5)
928 928
    def col_ustr(str_):
......
1017 1017
    insert_in_pkeys = insert_pkeys_table('in')
1018 1018
    
1019 1019
    # Do inserts and selects
1020
    join_cols = sql_gen.ColDict()
1020
    join_cols = sql_gen.ColDict(out_table)
1021 1021
    while True:
1022 1022
        if limit_ref[0] == 0: # special case
1023 1023
            log_debug('Creating an empty pkeys table')

Also available in: Unified diff