Revision 2925
Added by Aaron Marcuse-Kubitza about 12 years ago
csv2db | ||
---|---|---|
59 | 59 |
sql.create_table(db, errors_table, typed_cols, has_pkey=False) |
60 | 60 |
index_cols = ['column', 'value', 'error_code', 'error'] |
61 | 61 |
sql.add_index(db, index_cols, errors_table, unique=True) |
62 |
db.db.commit() |
|
63 | 62 |
|
64 | 63 |
use_copy_from = [True] |
65 | 64 |
|
... | ... | |
122 | 121 |
line_in.close() # also closes proc.stdout |
123 | 122 |
proc.wait() |
124 | 123 |
sql.with_savepoint(db, load_) |
125 |
db.db.commit() |
|
126 | 124 |
|
127 | 125 |
log('Cleaning up table') |
128 | 126 |
sql.cleanup_table(db, table, col_names) |
129 |
db.db.commit() |
|
130 | 127 |
|
131 | 128 |
log('Adding indexes') |
132 | 129 |
for col in typed_cols[1:]: # exclude pkey |
133 | 130 |
log('Adding index on '+col.name) |
134 | 131 |
sql.add_index(db, col.name, table, ensure_not_null=False) |
135 |
db.db.commit() |
|
136 | 132 |
|
137 | 133 |
log('Vacuuming table') |
138 | 134 |
db.db.rollback() |
Also available in: Unified diff
Removed unnecessary db.db.commit() calls because commits are now done automatically by DbConn's autocommit mode