Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session manager/ session maker #574

Open
eddyizm opened this issue Nov 17, 2023 · 0 comments
Open

session manager/ session maker #574

eddyizm opened this issue Nov 17, 2023 · 0 comments

Comments

@eddyizm
Copy link

eddyizm commented Nov 17, 2023

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()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant