Lame question here. When running
async with engine.acquire() as conn:
await conn.execute(...)
will the context manager close connection automatically? And does it imply that postgres connection will be closed too?
Lame question here. When running
async with engine.acquire() as conn:
await conn.execute(...)
will the context manager close connection automatically? And does it imply that postgres connection will be closed too?
Copyright © 2021 Jogjafile Inc.
From the code, it looks as if exiting the context manager will close the SQLAlchemy connection, but return it to the connection pool, so the Postgresql connection will remain open until the pool is released.