fastapi-boilerplate/app/api/deps.py
Finn Christiansen d8607212da
Some checks failed
Python formatting PEP8 / Python-PEP8 (push) Failing after 18s
added structured api endpoints and done some refactoring
2023-08-12 00:20:51 +02:00

11 lines
182 B
Python

from typing import Generator
from db.database import SessionLocal
def get_db() -> Generator:
try:
db = SessionLocal()
yield db
finally:
db.close()