mirror of
https://github.com/Alexander-D-Karpov/akarpov
synced 2024-11-15 04:26:39 +03:00
11 lines
196 B
Python
11 lines
196 B
Python
|
from redirect.db import SessionLocal
|
||
|
|
||
|
|
||
|
def get_db():
|
||
|
"""Route dependency that provides a database session."""
|
||
|
db = SessionLocal()
|
||
|
try:
|
||
|
yield db
|
||
|
finally:
|
||
|
db.close()
|