Get a database session.
(self)
| 61 | |
| 62 | @asynccontextmanager |
| 63 | async def get_db(self) -> T.AsyncGenerator[AsyncSession, None]: |
| 64 | """Get a database session.""" |
| 65 | if not self.inited: |
| 66 | await self.initialize() |
| 67 | self.inited = True |
| 68 | async with self.AsyncSessionLocal() as session: |
| 69 | yield session |
| 70 | |
| 71 | @deprecated(version="4.0.0", reason="Use get_platform_stats instead") |
| 72 | @abc.abstractmethod |
no test coverage detected