This commit is contained in:
9
api/deps.py
Normal file
9
api/deps.py
Normal file
@ -0,0 +1,9 @@
|
||||
from config.database import SessionLocal
|
||||
from fastapi import Depends
|
||||
|
||||
def get_db():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
||||
Reference in New Issue
Block a user