MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / get_db

Function get_db

generation/app/database.py:39–49  ·  view source on GitHub ↗

Dependency to get database session.

()

Source from the content-addressed store, hash-verified

37
38
39async def get_db() -> AsyncSession:
40 """Dependency to get database session."""
41 async with async_session_maker() as session:
42 try:
43 yield session
44 await session.commit()
45 except Exception:
46 await session.rollback()
47 raise
48 finally:
49 await session.close()
50
51
52async def init_db():

Callers

nothing calls this directly

Calls 3

commitMethod · 0.80
rollbackMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected