From e3176cd155b112be6f1a8c82ae51fdf82391961b Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Fri, 22 Sep 2023 22:26:56 -0400 Subject: [PATCH] sqlExport: Use `insert_many()` to bulk insert transactions --- memberPlumbing/sqlExport.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/memberPlumbing/sqlExport.py b/memberPlumbing/sqlExport.py index b6e6ae0..ec23798 100755 --- a/memberPlumbing/sqlExport.py +++ b/memberPlumbing/sqlExport.py @@ -72,8 +72,12 @@ def do_import(config): ] ) - for transaction in transactions: - Transaction.from_csv_dict(transaction).insert_instance().execute() + Transaction.insert_many( + [ + Transaction.from_csv_dict(transaction).__data__ + for transaction in transactions + ] + ).execute() # TODO: folders, levels, addons