Skip to content
Discussion options

You must be logged in to vote

hey there -

the connection is returned to the connection pool when you call commit(). to use the method that you're using, you would need to call session.connection() after each commit:


session: Session = EngineSession()
session.connection(execution_options={"schema_translate_map": {None: "test_schema"}})


order = Order(Status="CREATED")
session.add(order)
session.commit()
session.connection(execution_options={"schema_translate_map": {None: "test_schema"}})
session.refresh(order)

instead, create an engine with the options you need:


EngineSession = sessionmaker(bind=engine.execution_options(schema_translate_map={None: "test_schema"}))
session: Session = EngineSession()

order = Order(…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@pellejacobs
Comment options

@zzzeek
Comment options

@zzzeek
Comment options

Answer selected by pellejacobs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5977 on February 25, 2021 15:57.