mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add get_state
This commit is contained in:
parent
35b615158f
commit
546ffa9536
1 changed files with 11 additions and 1 deletions
|
|
@ -74,7 +74,17 @@ class SqliteStorage(BaseStorage):
|
|||
await self._connection.commit()
|
||||
|
||||
async def get_state(self, key: StorageKey) -> Optional[str]:
|
||||
pass
|
||||
id = self._key_builder.build(key)
|
||||
|
||||
cursor = await self._connection.execute(
|
||||
f"""SELECT state
|
||||
FROM aiogram_fsm
|
||||
WHERE id = ?""",
|
||||
(id),
|
||||
)
|
||||
|
||||
row = await cursor.fetchone()
|
||||
return row[0] if row else None
|
||||
|
||||
async def set_data(self, key: StorageKey, data: Mapping[str, Any]) -> None:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue