I\'m trying to insert values into a Postgres11 database with raw sqlalchemy text()
queries.
The following SQL query works correctly when I run it through psql-clien
I had a similar issue and the following code helped me. Without the conn.execute("COMMIT;")
part, I was not able to see all my changes reflected in my database.
with self.engine.begin() as conn:
conn.execute(sql_query)
conn.execute("COMMIT;")
My question got answered on github.
The solution is to wrap the execute in a transaction context:
with engine.begin() as conn:
conn.execute("whatever")