Compatibility with psycopg2 2.9+
the autocommit = True is ignored in the `with connection` block
@@ -40,7 +40,8 @@ class Connection(object):
@contextmanager
def get_connection_cursor(**kwargs):
- with psycopg2.connect(**kwargs) as conn:
+ conn = psycopg2.connect(**kwargs)
conn.autocommit = True
with conn.cursor() as cur:
yield cur
+ conn.close()
