Open
Description
I'm currently at the point in the course where we're connecting to a SQLite database for the first time. You're using on_event()
from SQLModel to add an event handler for the application on startup like so: https://github.com/codesensei-courses/fastapi_fundamentals/blob/c4de006900b495acdf4b973154027f24d790b370/carsharing.py#L32C1-L32C24
However, it is indicated as deprecated on FastAPI's documentation: https://fastapi.tiangolo.com/advanced/events/#alternative-events-deprecated
Still, I am not sure how to reproduce this behavior using lifespan()
instead. Would you show us how you would do it in your code?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels