MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / get_db

Method get_db

astrbot/core/db/__init__.py:63–69  ·  view source on GitHub ↗

Get a database session.

(self)

Source from the content-addressed store, hash-verified

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

Callers 15

insert_platform_statsMethod · 0.45
count_platform_statsMethod · 0.45
get_platform_statsMethod · 0.45
insert_provider_statMethod · 0.45
get_conversationsMethod · 0.45
get_all_conversationsMethod · 0.45
create_conversationMethod · 0.45
update_conversationMethod · 0.45
delete_conversationMethod · 0.45

Calls 1

initializeMethod · 0.95

Tested by

no test coverage detected