Add get_state

This commit is contained in:
Oleg Matviichuk 2025-07-30 00:20:06 +02:00
parent 35b615158f
commit 546ffa9536

View file

@ -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