My current solution involves using the execute() method on sqlalchemy each time when I want to run multiple queries. for eg.
connection.connect().execute("query1")
connection.connect().execute("query2")
connection.connect().execute("query3")
This will execute the queries one by one, however it is possible that "query2" execution failed but the "query1" would have ran. how to revert back to original state in case any intermediary queries fail. Like if "query1" and "query2" ran but "query3" failed, then how do I make it rollback to original state