Revision 5027
Added by Aaron Marcuse-Kubitza about 12 years ago
sql_io.py | ||
---|---|---|
248 | 248 |
util.list_set_length(row, cols_ct) # truncate extra cols |
249 | 249 |
sql.insert(db, table, row, cacheable=False, log_level=5) |
250 | 250 |
|
251 |
def import_csv(db, table, stream, use_copy_from=True, has_row_num=True):
|
|
251 |
def import_csv(db, table, stream, use_copy_from=True): |
|
252 | 252 |
def log(msg, level=1): db.log_debug(msg, level) |
253 | 253 |
|
254 | 254 |
# Get format info |
... | ... | |
277 | 277 |
if use_copy_from: sql.with_savepoint(db, load) |
278 | 278 |
else: load() |
279 | 279 |
|
280 |
if has_row_num: sql.add_row_num(db, table, sql.pkey_col) |
|
281 | 280 |
cleanup_table(db, table) |
282 | 281 |
|
283 | 282 |
def put(db, table, row, pkey_=None, row_ct_ref=None): |
Also available in: Unified diff
sql_io.py: import_csv(): Don't add a row number column to the created table because it is now added automatically to the temp table by column-based import (row-based import now also does not require a pkey for DB inputs)