mfreeborn / fastapi-sqlalchemy

Adds simple SQLAlchemy support to FastAPI
MIT License
594 stars 34 forks source link

Routing does not need to be connected database through dependency injection ? #39

Closed Jieszs closed 3 months ago

Jieszs commented 3 years ago

@router.get("/metaEvents/{event_id}") async def get_one( event_id: int, db: Session = Depends(deps.get_db), ):

Jieszs commented 3 years ago

How to make sure the database session is always closed after the request. Even if there was an exception while processing the request.

Ewen-Zippedscript commented 3 months ago

Fixed in #49