mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 18:04:32 +02:00
insert_all(..., alter=True) works for columns introduced after first 100 records
* Insert all columns for every chunk * Update unit test to reflect new behaviour * Test that exception is raised * Update documentation Closes #139. Thanks, Simon Wiles!
This commit is contained in:
parent
ea87c2b943
commit
947bb7626f
3 changed files with 23 additions and 4 deletions
|
|
@ -1074,6 +1074,14 @@ class Table(Queryable):
|
|||
all_columns = list(sorted(all_columns))
|
||||
if hash_id:
|
||||
all_columns.insert(0, hash_id)
|
||||
else:
|
||||
all_columns += [
|
||||
column
|
||||
for record in chunk
|
||||
for column in record
|
||||
if column not in all_columns
|
||||
]
|
||||
|
||||
validate_column_names(all_columns)
|
||||
first = False
|
||||
# values is the list of insert data that is passed to the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue