From 1dbb384c85c0a3412a73c886a6528fd6a7887512 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 13 Aug 2022 13:04:25 -0700 Subject: [PATCH] Update use of sqlhelpers.insert_filler. --- droidz.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/droidz.py b/droidz.py index 87bb1d1..3fc6306 100644 --- a/droidz.py +++ b/droidz.py @@ -91,9 +91,9 @@ def insert_id(id, commit=True): if not existing: data = {'id': id} columns = SQL_COLUMNS['sticks'] - (qmarks, bindings) = sqlhelpers.insert_filler(columns, data, require_all=False) + (qmarks, bindings) = sqlhelpers.insert_filler(data) - query = f'INSERT INTO sticks VALUES({qmarks})' + query = f'INSERT INTO sticks {qmarks}' cur.execute(query, bindings) if commit: @@ -118,8 +118,8 @@ def insert_stick(data, commit=True): (qmarks, bindings) = sqlhelpers.update_filler(data, 'id') query = f'UPDATE sticks {qmarks}' else: - (qmarks, bindings) = sqlhelpers.insert_filler(SQL_COLUMNS['sticks'], data) - query = f'INSERT INTO sticks VALUES({qmarks})' + (qmarks, bindings) = sqlhelpers.insert_filler(data) + query = f'INSERT INTO sticks {qmarks}' cur.execute(query, bindings)