diff --git a/docs/reference/persister.rst b/docs/reference/persister.rst index 76d2bf14..8b610730 100644 --- a/docs/reference/persister.rst +++ b/docs/reference/persister.rst @@ -5,8 +5,29 @@ State Persistence Burr provides a set of tools to make loading and saving state easy. These are functions that will be used by lifecycle hooks to save and load state. +We currently support the following database integrations: + +.. table:: Burr Implemented Persisters + :widths: auto + + +-------------+-----------------------------------------------------------------+---------------------------------------------------------------------+ + | Database | Sync | Async | + +=============+===========+=====================================================+===============+=====================================================+ + | SQLite | sqlite3 | :ref:`SQLitePersister ` | aiosqlite | :ref:`AsyncSQLitePersister ` | + +-------------+-----------+-----------------------------------------------------+---------------+-----------------------------------------------------+ + | PostgreSQL | psycopg2 | :ref:`PostgreSQLPersister ` | asyncpg | :ref:`AsyncPostgreSQLPersister ` | + +-------------+-----------+-----------------------------------------------------+---------------+-----------------------------------------------------+ + | Redis | redis | :ref:`RedisBasePersister ` | redis.asyncio | :ref:`AsyncRedisBasePersister ` | + +-------------+-----------+-----------------------------------------------------+---------------+-----------------------------------------------------+ + | MongoDB | pymongo | :ref:`MongoDBBasePersister ` | ❌ | ❌ | + +-------------+-----------+-----------------------------------------------------+---------------+-----------------------------------------------------+ + +We follow the naming convention ``b_dependency-library``, where the ``b_`` is used to avoid name +clashing with the underlying library. We chose the library name in case we implement the same database +persister with different dependency libraries to keep the class naming convention. + If you want to implement your own state persister (to bridge it with a database), you should implement -the ``BaseStatePersister`` interface. +the ``BaseStatePersister`` or the ``AsyncBaseStatePersister`` interface. .. autoclass:: burr.core.persistence.BaseStatePersister :members: @@ -61,23 +82,30 @@ Supported Sync Implementations Currently we support the following, although we highly recommend you contribute your own! We will be adding more shortly. +.. _syncsqliteref: + .. autoclass:: burr.core.persistence.SQLitePersister :members: .. automethod:: __init__ +.. _syncpostgresref: -.. autoclass:: burr.integrations.persisters.postgresql.PostgreSQLPersister +.. autoclass:: burr.integrations.persisters.b_psycopg2.PostgreSQLPersister :members: .. automethod:: __init__ +.. _syncredisref: + .. autoclass:: burr.integrations.persisters.b_redis.RedisBasePersister :members: .. automethod:: __init__ -.. autoclass:: burr.integrations.persisters.b_mongodb.MongoDBBasePersister +.. _syncmongoref: + +.. autoclass:: burr.integrations.persisters.b_pymongo.MongoDBBasePersister :members: .. automethod:: __init__ @@ -90,20 +118,26 @@ although it uses different mechanisms to save state (as it tracks more than just Supported Async Implementations ================================ +.. _asyncpersistersref: + Currently we support the following, although we highly recommend you contribute your own! We will be adding more shortly. -.. _asyncpersistersref: +.. _asyncsqliteref: .. autoclass:: burr.integrations.persisters.b_aiosqlite.AsyncSQLitePersister :members: .. automethod:: __init__ -.. autoclass:: burr.integrations.persisters.postgresql.AsyncPostgreSQLPersister +.. _asyncpostgresref: + +.. autoclass:: burr.integrations.persisters.b_asyncpg.AsyncPostgreSQLPersister :members: .. automethod:: __init__ +.. _asyncredisref: + .. autoclass:: burr.integrations.persisters.b_redis.AsyncRedisBasePersister :members: