Skip to content

dimonier/SQLiteStorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQLiteStorage

Simple aiogram FSM storage, stores all FSM data in SQLite database

Intended to replace MemoryStorage for simple cases where you want to keep states between bot restarts.

Implements just basic BaseStorage methods such as:

  • set_state()
  • get_state()
  • set_data()
  • get_data()
  • update_data()
  • close()

Tests are based on original aiogram tests.

Installation

Copy sqlitestorage folder to your project.

Usage

Include the following in your script:

# import aiogram and the rest
from sqlitestorage.storage import SQLiteStorage

dp = Dispatcher(bot, storage=SQLiteStorage())

Using SQLiteStorage() instead of MemoryStorage() makes your FSM data persistent between bot restarts.

About

aiogram FSM storage, stores all data in SQLite database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages