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:
Simon Wiles 2020-08-28 15:30:13 -07:00 committed by GitHub
commit 947bb7626f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 4 deletions

View file

@ -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