From a68b10a930e8aff18da52280f6d6dbc798028be8 Mon Sep 17 00:00:00 2001 From: Eduardo Blancas Date: Thu, 29 Jun 2023 12:57:51 -0600 Subject: [PATCH] sqlalchemyy 2 fix --- src/sql/run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/sql/run.py b/src/sql/run.py index 965c01a5e..fa27ea24a 100644 --- a/src/sql/run.py +++ b/src/sql/run.py @@ -652,7 +652,11 @@ def run(conn, sql, config): resultset = ResultSet(result, config, statement, conn.engine) session.commit() else: - result = conn.engine.execute(statement) + # we need the session so sqlalchemy 2.x works + # result = conn.engine.execute(statement) + with Session(conn.engine) as session: + result = session.execute(statement) + resultset = ResultSet(result, config, statement, conn.engine) if result and config.feedback: