MCPcopy Create free account
hub / github.com/dbunt1tled/python-fast-api / session

Method session

src/core/db/asmysql.py:34–43  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32
33 @asynccontextmanager
34 async def session(self) -> AsyncGenerator[AsyncSession]:
35 async with self.async_session_factory() as session:
36 try:
37 yield session
38 await session.commit()
39 except Exception:
40 await session.rollback()
41 raise
42 finally:
43 await session.close()
44
45 async def close(self) -> None:
46 if self.engine is not None:

Callers 1

get_sessionMethod · 0.80

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected