Revision 5337
Added by Aaron Marcuse-Kubitza about 12 years ago
sql_io.py | ||
---|---|---|
25 | 25 |
def cleanup_table(db, table): |
26 | 26 |
table = sql_gen.as_Table(table) |
27 | 27 |
cols = [sql_gen.as_Col(strings.ustr(c), table) |
28 |
for c in sql.table_cols(db, table)] |
|
28 |
for c in sql.table_col_names(db, table)]
|
|
29 | 29 |
cols = filter(lambda c: sql_gen.is_text_col(db, c), cols) |
30 | 30 |
try: cols.remove(sql.pkey_col_(db, table)) |
31 | 31 |
except ValueError: pass |
... | ... | |
222 | 222 |
##### Import |
223 | 223 |
|
224 | 224 |
def append_csv(db, table, stream_info, stream, use_copy_from=True): |
225 |
assert sql.table_cols(db, table) == stream_info.header |
|
225 |
assert sql.table_col_names(db, table) == stream_info.header
|
|
226 | 226 |
|
227 | 227 |
def log(msg, level=1): db.log_debug(msg, level) |
228 | 228 |
|
... | ... | |
469 | 469 |
else: |
470 | 470 |
out_table_cols = sql_gen.ColDict(db, out_table) |
471 | 471 |
out_table_cols.update(util.dict_subset_right_join({}, |
472 |
sql.table_cols(db, out_table))) |
|
472 |
sql.table_col_names(db, out_table)))
|
|
473 | 473 |
|
474 | 474 |
in_cols = [] |
475 | 475 |
cond = sql.map_expr(db, cond, mapping, in_cols) |
Also available in: Unified diff
sql.py: Renamed table_cols() to table_col_names() for clarity, because it does not return sql_gen.Col objects