Skip to content

session manager/ session maker #574

Open
@eddyizm

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions