SqlitePersistor class

Inheritance
Mixed-in types

Constructors

SqlitePersistor({void onPersist(Set<Document> batch)?, void onClear(Set<Collection> collections)?, void onClearAll()?, void onHydrate(Json data)?, DataStoreEncrypter? encrypter, PersistorSettings settings = const PersistorSettings(), Duration persistenceThrottle = const Duration(milliseconds: 100), void onSync()?, bool useFfi = false})

Properties

encrypter DataStoreEncrypter
finalinherited
hashCode int
The hash code for this object.
no setterinherited
logger Logger
finalinherited
onClear → void Function(Set<Collection> collections)?
finalinherited
onClearAll → void Function()?
finalinherited
onHydrate → void Function(Json data)?
finalinherited
onPersist → void Function(Set<Document> batch)?
finalinherited
onSync → void Function()?
finalinherited
persistenceThrottle Duration
The throttle for batching persisted documents. All documents updated within the throttle duration are batched together into a single persist operation.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settings PersistorSettings
finalinherited
useFfi bool
Whether to use the FFI database factory. This is necessary for certain environments such as testing.
final
worker PersistorWorkerMessenger
latefinalinherited

Methods

clear(List<Collection> collections) Future<void>
Clear function used to clear all documents under the given collections.
override
clearAll() Future<void>
Clears all documents and removes all persisted data.
override
hydrate([List<StoreReference>? refs]) Future<Json>
Hydration function called to read data from persistence. If no entities are specified, then it hydrations all persisted data. if entities are specified, it hydrates only the data from the paths under those entities.
override
init() Future<void>
Public APIs to be implemented by any Persistor extension like FilePersistor.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
persist(List<Document> docs) Future<void>
Persist function called with the bath of documents that have changed (including been deleted) within the last throttle window specified by the Persistor.persistenceThrottle duration.
override
spawnWorker<T extends PersistorWorker<S>, S extends PersistorWorkerConfig>(T factory(S config), {required S config}) Future<void>
Spawns an instance of the worker specified by the factory on a background isolate and returns a PersistorWorkerMessenger for communicating with the spawned worker.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

initDB() Future<Database>
Initializes the database on the current isolate. Used by both the worker and test environment for accessing data from the DB.

Constants

dbName → const String
dbVersion → const int
keyColumn → const String
tableName → const String
valueColumn → const String