The table.insert_all() and table.upsert_all() methods currently only work with iterators of dictionaries, where each dictionary represents a row and the column names are the keys.
This is inefficient over large number of rows.
How about if they could also accept iterators that look like this?
def rows():
yield "id", "title", "content"
for row in some_other_source():
yield row.id, row.title, row.content
This looks similar to CSV. The first "row" is the column titles, subsequent rows are the row values themselves.
The
table.insert_all()andtable.upsert_all()methods currently only work with iterators of dictionaries, where each dictionary represents a row and the column names are the keys.This is inefficient over large number of rows.
How about if they could also accept iterators that look like this?
This looks similar to CSV. The first "row" is the column titles, subsequent rows are the row values themselves.