aboutsummaryrefslogtreecommitdiffstats
path: root/todb.py
diff options
context:
space:
mode:
Diffstat (limited to 'todb.py')
-rw-r--r--todb.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/todb.py b/todb.py
index d911a29..e5988cd 100644
--- a/todb.py
+++ b/todb.py
@@ -11,7 +11,8 @@ pg_pass = os.environ['el_pg_pass']
def todb(sql, values):
with psycopg.connect(dbname=pg_db, host=pg_host, user=pg_user, password=pg_pass) as conn:
if type(values) == list:
- conn.executemany(sql, values)
+ cur = conn.cursor()
+ cur.executemany(sql, values)
elif type(values) == tuple:
conn.execute(sql, values)
else: