Revision 2289
Added by Aaron Marcuse-Kubitza over 12 years ago
csv2db | ||
---|---|---|
101 | 101 |
row = map(strings.to_unicode, row) |
102 | 102 |
row.insert(0, sql.default) # leave space for autogen row_num |
103 | 103 |
util.list_set_length(row, cols_ct) # truncate extra cols |
104 |
sql.insert(db, esc_table, row, table_is_esc=True)
|
|
104 |
sql.insert(db, table, row)
|
|
105 | 105 |
finally: |
106 | 106 |
line_in.close() # also closes proc.stdout |
107 | 107 |
proc.wait() |
108 | 108 |
|
109 | 109 |
# Clean up the data |
110 | 110 |
sys.stderr.write('Cleaning up table\n') |
111 |
sql.cleanup_table(db, esc_table, cols, table_is_esc=True)
|
|
111 |
sql.cleanup_table(db, table, cols)
|
|
112 | 112 |
load = lambda: sql.with_savepoint(db, load_) |
113 | 113 |
|
114 | 114 |
try: load() |
Also available in: Unified diff
csv2db: Switched to using plain table names rather than table_is_esc