Coverage for src/app/db/session.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v7.14.3, created at 2026-06-24 08:34 +0000

1from sqlalchemy.orm import sessionmaker 

2 

3from app.db.engine import engine 

4 

5SessionLocal = sessionmaker( 

6 bind=engine, 

7 autoflush=False, 

8 autocommit=False, 

9) 

10 

11 

12# ------------------------------------------------- 

13# FASTAPI DEPENDENCY 

14# ------------------------------------------------- 

15def get_session(): 

16 session = SessionLocal() 

17 try: 

18 yield session 

19 finally: 

20 session.close()