Skip to content

Commit

Permalink
sqlalchemyy 2 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
edublancas committed Jun 29, 2023
1 parent 879afd5 commit a68b10a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sql/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a68b10a

Please sign in to comment.