Project

General

Profile

« Previous | Next » 

Revision 2682

csv2db: Create errors table for use by column-based import

View differences:

csv2db
104 104
                line_in.close() # also closes proc.stdout
105 105
                proc.wait()
106 106
        sql.with_savepoint(db, load_)
107
        
108 107
        db.db.commit()
109 108
        
110 109
        log('Cleaning up table')
......
116 115
            log('Adding index on '+name)
117 116
            sql.add_index(db, sql_gen.Col(name, table))
118 117
            db.db.commit()
118
        
119
        log('Creating errors table')
120
        typed_cols = [sql_gen.TypedCol('column', 'text NOT NULL'),
121
            sql_gen.TypedCol('value', 'text'),
122
            sql_gen.TypedCol('error', 'text')]
123
        sql.create_table(db, table+'_errors', typed_cols, has_pkey=False)
124
        db.db.commit()
119 125
    
120 126
    try: load()
121 127
    except sql.DatabaseErrors, e:

Also available in: Unified diff