From 1fe6de793cfcc476377145b9e71d92351827dce1 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 13 Aug 2022 07:24:31 -0700 Subject: [PATCH] Update worms to match sqlhelpers. --- voussoirkit/worms.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/voussoirkit/worms.py b/voussoirkit/worms.py index e2d17f4..411559c 100644 --- a/voussoirkit/worms.py +++ b/voussoirkit/worms.py @@ -421,13 +421,12 @@ class Database(metaclass=abc.ABCMeta): tables = set(self.select_column(query)) return tables - def insert(self, table, data) -> sqlite3.Cursor: + def insert(self, table, pairs) -> sqlite3.Cursor: if isinstance(table, type) and issubclass(table, Object): table = table.table self.assert_table_exists(table) - column_names = self.COLUMNS[table] - (qmarks, bindings) = sqlhelpers.insert_filler(column_names, data) - query = f'INSERT INTO {table} VALUES({qmarks})' + (qmarks, bindings) = sqlhelpers.insert_filler(pairs) + query = f'INSERT INTO {table} {qmarks}' return self.execute(query, bindings) def normalize_object_id(self, object_class, object_id):