persisters
The persisters module of the TinyBase project provides a simple framework for saving and loading Store and MergeableStore data, to and from different destinations, or underlying storage types.
Many entry points are provided (in separately installed modules), each of which returns different types of Persister that can load and save a Store. Between them, these allow you to store your TinyBase data locally, remotely, to a Durable Object, to SQLite and PostgreSQL databases, and across synchronization boundaries with CRDT frameworks.
(*) Note that SQLite- and PostgreSQL-based Persisters can currently only persist MergeableStore data when used with the JSON-based DpcJson mode, and not when using the DpcTabular mode.
Since persistence requirements can be different for every app, the createCustomPersister function in this module can also be used to easily create a fully customized way to save and load Store data.
Similarly, the createCustomSqlitePersister function and createCustomPostgreSqlPersister function can be used to build Persister objects against SQLite and PostgreSQL SDKs (or forks) that are not already included with TinyBase.
See also
- Persistence guides
- Countries demo
- Todo App demos
- Drawing demo
Since
v1.0.0