Thanks to @AdrianKlaver in the comments - got me on the right track.
Here's the solution I went with to ensure a COMMIT
was issued:
from sqlalchemy import create_engine
from sqlalchemy.schema import CreateSchema
def main():
conn_str = "postgresql+psycopg2://philipjoss:Mombassa11@localhost/belgarath_test"
engine = create_engine(conn_str, echo=True)
with engine.connect().execution_options(isolation_level="AUTOCOMMIT") as connection:
with connection.begin():
connection.execute(CreateSchema("test_schema"))
if __name__ == "__main__":
main()