aboutsummaryrefslogtreecommitdiffstats
path: root/todb.py
diff options
context:
space:
mode:
authorDennis Eriksen <d@ennis.no>2023-02-01 12:24:22 +0100
committerDennis Eriksen <d@ennis.no>2023-02-01 12:24:22 +0100
commitd86413ad81135454df7ef1c7d7faeb52eb51efa8 (patch)
treefaf9e7cc5bc728065f4d87f86db7c8b190ba42ed /todb.py
parentuse new db thingy (diff)
downloadenergyscripts-d86413ad81135454df7ef1c7d7faeb52eb51efa8.tar.gz
adding some common stuff, less code replica
Diffstat (limited to 'todb.py')
-rw-r--r--todb.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/todb.py b/todb.py
index e5988cd..7426ace 100644
--- a/todb.py
+++ b/todb.py
@@ -13,8 +13,10 @@ def todb(sql, values):
if type(values) == list:
cur = conn.cursor()
cur.executemany(sql, values)
+ return cur.rowcount
elif type(values) == tuple:
conn.execute(sql, values)
+ return 1
else:
print("OH SHIT")
exit()