Better integration of sqlite3 database
This commit is contained in:
9
backend/app/dependencies.py
Normal file
9
backend/app/dependencies.py
Normal file
@ -0,0 +1,9 @@
|
||||
# app/dependencies.py
|
||||
from app.database import SessionLocal # Import SessionLocal from database.py
|
||||
|
||||
def get_db():
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
finally:
|
||||
db.close()
|
Reference in New Issue
Block a user