Project

General

Profile

« Previous | Next » 

Revision 5051

sql_io.py: append_csv(): Using INSERT: Use ignore mode to support inserting rows into a table with a unique constraint

View differences:

lib/sql_io.py
248 248
        for row in csvs.make_reader(stream, dialect):
249 249
            row = map(strings.to_unicode, row)
250 250
            util.list_set_length(row, cols_ct) # truncate extra cols
251
            sql.insert(db, table, row, cacheable=False, log_level=5)
251
            sql.insert(db, table, row, ignore=True, cacheable=False,
252
                log_level=5)
252 253

  
253 254
def import_csv(db, table, stream, use_copy_from=True):
254 255
    def log(msg, level=1): db.log_debug(msg, level)

Also available in: Unified diff