From 3901f43c6a712a1a3efc340b5b8d8fd0cbe8ee63 Mon Sep 17 00:00:00 2001 From: Simon Wiles Date: Thu, 27 Aug 2020 13:05:59 -0700 Subject: [PATCH] Insert all columns for every chunk --- sqlite_utils/db.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sqlite_utils/db.py b/sqlite_utils/db.py index a8791c3..75599f6 100644 --- a/sqlite_utils/db.py +++ b/sqlite_utils/db.py @@ -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