Project

General

Profile

« Previous | Next » 

Revision 2060

Calls to sql.esc_name*(): Removed preserve_case=True because it is now the default

View differences:

db_xml.py
132 132
        place of the column value.
133 133
    @param commit Whether to commit after each query
134 134
    '''
135
    def qual_name(table): sql.qual_name(db, in_schema, table)
136
    
135
    def qual_name(table): return sql.qual_name(db, in_schema, table)
137 136
    def pkey(table): return sql.pkey(db, table, True)
138 137
    
139 138
    out_table = name_of(node)
......
152 151
    try: del row[pkey_]
153 152
    except KeyError: pass
154 153
    
154
    # Divide fields into input columns and literal values
155
    for out_col, value in row.iteritems():
156
        in_col = strings.remove_prefix('$', value)
157
        if in_col != value: row[out_col] = in_col # value is input column
158
        else: row[out_col] = (value, out_col) # value is literal value
159
    
160
    # Insert node
161
    out_cols = row.keys()
162
    map(sql.check_name, out_cols)
163
    select_query, params = sql.mk_select(db, qual_name(in_table), row.values(),
164
        table_is_esc=True)
165
    sql.run_query(db, 'INSERT INTO '+out_table+' ('+', '.join(out_cols)+') '
166
        +select_query, params)
167
    
155 168
    import sys; sys.stderr.write(str(node))
156 169
    if commit: db.db.commit()
157 170
    raise NotImplementedError('By-column optimization not available yet')

Also available in: Unified diff