QueueStore class abstract
Interface for the local sync queue storage.
The queue holds pending operations that need to be pushed to the remote. Implement this with your local database, or use the provided DriftQueueStore adapter.
- Implementers
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearAll(
) → Future< void> - Hard delete EVERYTHING in the queue (pending or synced). Required for session isolation.
-
deleteEntry(
String id) → Future< void> - Permanently delete an entry from the queue (e.g., dead letter / poison pill).
-
enqueue(
SyncEntry entry) → Future< void> - Add an entry to the sync queue.
-
getPending(
{int limit = 50, DateTime? now}) → Future< List< SyncEntry> > -
Get pending (un-synced) entries, oldest first.
If
nowis provided, only returns entries where nextRetryAt is null or <= now. -
getPendingEntries(
String table, String recordId) → Future< List< SyncEntry> > - Get all pending entries for a specific table and record ID. Used during conflict resolution to access the local pending payload.
-
getPendingIds(
String table) → Future< Set< String> > -
Get a set of record IDs that have pending sync entries for a specific
table. Useful for batching checks during pulls to avoid N+1 query bottlenecks. -
hasPending(
String table, String id) → Future< bool> - Check if a specific record has a pending sync entry.
-
incrementRetry(
String id) → Future< void> - Increment the retry count for a failed entry.
-
markSynced(
String id) → Future< void> - Mark an entry as successfully synced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
purgeSynced(
{Duration retention = const Duration(days: 30)}) → Future< void> -
Delete synced entries older than
retention. -
setNextRetryAt(
String id, DateTime nextRetryAt) → Future< void> - Set the next eligible retry time for backoff scheduling.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited