LocalStore<T, Id> class abstract interface

LocalStore abstracts local persistence for syncable models.

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportsSoftDelete bool
Whether this store performs soft delete (set deletedAt) instead of hard delete.
no setter

Methods

approxCacheSizeBytes({SyncScope? scope}) Future<int>
Cache management APIs Returns an approximate size of the local cache in bytes. When scope is provided, the size is calculated only for that scope; otherwise it is for the whole store.
clearCache({SyncScope? scope}) Future<void>
Clears cached data. When scope is provided, clears only that scope; otherwise clears all data. Implementations should also clear sync points and pending operations for the cleared scope(s).
clearPendingOps(SyncScope scope, List<String> opIds) Future<void>
deleteMany(SyncScope scope, List<Id> ids) Future<void>
Delete semantics within the given scope:
deleteWhere(SyncScope scope, QuerySpec spec) Future<int>
Delete items that match spec within the scope. Applies soft/hard delete semantics in the same way as deleteMany. Returns the number of affected rows if available, else -1.
enqueuePendingOp(PendingOp<T, Id> op) Future<void>
getById(Id id) Future<T?>
getCacheSizeLimitBytes() Future<int?>
Returns the cache size limit in bytes, or null if unlimited.
getPendingOps(SyncScope scope) Future<List<PendingOp<T, Id>>>
getSyncPoint(SyncScope scope) Future<DateTime?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(SyncScope scope) Future<List<T>>
querySince(SyncScope scope, DateTime since) Future<List<T>>
queryWith(SyncScope scope, QuerySpec spec) Future<List<T>>
Query with general DB-like filters, ordering and pagination within a scope. This does not escape the scope and respects soft-delete semantics.
saveSyncPoint(SyncScope scope, DateTime timestamp) Future<void>
setCacheSizeLimitBytes(int? bytes) Future<void>
Sets the cache size limit in bytes. When null, no limit is enforced.
toString() String
A string representation of this object.
inherited
updateWhere(SyncScope scope, QuerySpec spec, List<T> newValues) Future<int>
Update items that match spec within the scope. For stores that support soft delete, implementations SHOULD avoid updating tombstoned rows. Returns the number of affected rows if available, else -1.
upsertMany(SyncScope scope, List<T> items) Future<void>
Upsert items that belong to the given scope.

Operators

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