modify: session 代码提示
This commit is contained in:
@@ -25,7 +25,7 @@ class Database:
|
|||||||
expire_on_commit=False
|
expire_on_commit=False
|
||||||
) # type: ignore
|
) # type: ignore
|
||||||
|
|
||||||
def get_session(self):
|
def get_session(self) -> AsyncSession:
|
||||||
"""返回一个异步上下文管理器,用于获取会话"""
|
"""返回一个异步上下文管理器,用于获取会话"""
|
||||||
if self._session_maker is None:
|
if self._session_maker is None:
|
||||||
raise RuntimeError("Database not initialized")
|
raise RuntimeError("Database not initialized")
|
||||||
|
|||||||
Reference in New Issue
Block a user