SqliteEventStorage class

Durable event storage using sqflite with WAL mode. Maps closely to the Unity SDK's SQLite storage layer.

Constructors

SqliteEventStorage({int maxEvents = defaultMaxEvents})

Properties

hashCode int
The hash code for this object.
no setterinherited
isOpen bool
no setter
maxEvents int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearLegacyMigrationJournal() Future<void>
consumeDestructiveRecoveryDetected() bool
This replay signal is consumed by higher layers for any local durability loss that requires critical-event reconciliation, including cap eviction of priority rows and destructive corruption recovery.
consumeDroppedDueToCap() int
containsEvent(String eventName, int tsMillis) Future<bool?>
deleteByIds(List<int> ids) Future<int>
Delete events by their IDs.
dispose() Future<void>
Close and dispose the database.
enforceDbCaps() Future<int>
Enforce maximum event count and database size caps. Evicts non-priority events first, then oldest priority events.
findExistingIds(List<int> ids) Future<Set<int>>
getDbSizeBytes() Future<int>
Get approximate DB file size in bytes.
getEventCount() Future<int>
Get total event count.
insertEvent(int tsMillis, String eventName, String payloadJson) Future<bool>
Insert an event into the database.
migrateLegacyEventIfNeeded({required int sourcePosition, required int tsMillis, required String eventName, required String payloadJson}) Future<LegacyMigrationInsertResult>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onFlushComplete() Future<void>
Increment flush counter and run WAL checkpoint every 10 flushes.
open() Future<bool>
Open the database, apply PRAGMAs, create table if needed.
readOldestEvents(int limit) Future<List<EventRow>>
Read oldest events, with priority events first.
readOldestEventsExcludingIds(int limit, Set<int> excludedIds) Future<List<EventRow>>
readPriorityEvents(int limit) Future<List<EventRow>>
Read only priority events.
toString() String
A string representation of this object.
inherited
walCheckpoint() Future<void>
Run WAL checkpoint passively.

Operators

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

Static Methods

getDbFamilySizeBytes(String fullPath) Future<int>
isLikelyCorruptionError(Object error) bool

Constants

defaultMaxEvents → const int
maxDbSizeBytes → const int