DriftQueueStore class

QueueStore implementation backed by a Drift DynosSyncQueueTable.

Requires DynosSyncQueueTable to be registered in your Drift database.

Implemented types

Constructors

DriftQueueStore(GeneratedDatabase _db)
Creates a DriftQueueStore backed by the given Drift GeneratedDatabase.
const

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.
override
deleteEntry(String id) Future<void>
Permanently delete an entry from the queue (e.g., dead letter / poison pill).
override
enqueue(SyncEntry entry) Future<void>
Add an entry to the sync queue.
override
getPending({int limit = 50, DateTime? now}) Future<List<SyncEntry>>
Get pending (un-synced) entries, oldest first. If now is provided, only returns entries where nextRetryAt is null or <= now.
override
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.
override
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.
override
hasPending(String table, String id) Future<bool>
Check if a specific record has a pending sync entry.
override
incrementRetry(String id) Future<void>
Increment the retry count for a failed entry.
override
markSynced(String id) Future<void>
Mark an entry as successfully synced.
override
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.
override
setNextRetryAt(String id, DateTime nextRetryAt) Future<void>
Set the next eligible retry time for backoff scheduling.
override
toString() String
A string representation of this object.
inherited

Operators

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