raito.utils.storages.sql.sqlalchemy moduleΒΆ
- class raito.utils.storages.sql.sqlalchemy.SQLAlchemyStorage(engine, session_factory=None, key_separator=':')[source]ΒΆ
Bases:
BaseStorageSQLAlchemy storage for FSM.
- Parameters:
engine (AsyncEngine)
session_factory (async_sessionmaker[AsyncSession] | None)
key_separator (str)
- async classmethod from_url(url, *, echo=False, pool_size=10, max_overflow=0, **kwargs)[source]ΒΆ
Create storage from database URL.
- async get_state(key)[source]ΒΆ
Get key state.
- Parameters:
key (StorageKey) β Storage key
- Returns:
Current state
- Return type:
str | None
- async get_data(key)[source]ΒΆ
Get current data for key.
- Parameters:
key (StorageKey) β Storage key
- Returns:
Current data
- Return type:
Dict[str, Any]