diff options
author | dennis <d@ennis.no> | 2023-01-31 21:13:35 +0100 |
---|---|---|
committer | dennis <d@ennis.no> | 2023-01-31 21:13:35 +0100 |
commit | 9cb0e8739b00337dc70aa3a0909f4880f2d5b5e1 (patch) | |
tree | 077e9f0d6fc3ab236cb2d86f20416e7ef8550571 /todb.py | |
parent | added queue, in case db-connection is down (diff) | |
download | energyscripts-9cb0e8739b00337dc70aa3a0909f4880f2d5b5e1.tar.gz |
use new db thingy
Diffstat (limited to 'todb.py')
-rw-r--r-- | todb.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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: |