Open
Description
I see the await database.connect()
used but is that the equivalent to sqlalchemy's orm.sessionmaker?
Do I just open a new connection every time up to the defined limit and databases
handles them in the connection pool?
I do have the connection and disconnection at start up - but seem to have to call the connect function again as a dependency whenever I try to execute a query elsewhere in the code
@app.on_event("startup")
async def startup():
await database.connect()
@app.on_event("shutdown")
async def shutdown():
await database.disconnect()
Metadata
Assignees
Labels
No labels