SqliteAtCommitLog class

SQLite-backed AtCommitLog. One row per atKey, newest-wins, with a dense/gapless commit_id allocated from the counters table in the same transaction as the keystore write (see commitSync).

Inheritance

Constructors

SqliteAtCommitLog(SqliteDatabase _db)

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

close() Future<void>
Close the underlying storage handle.
override
commit(String key, CommitOp operation) Future<int?>
Append a new entry for key / operation. Returns the assigned commitId, or -1 for keys that bypass the commit log (private:, privatekey:, public:_, local:, ...).
override
commitSync(String atKey, CommitOp operation) int?
Synchronous commit used inside a keystore write's transaction so the value row and its commit entry are one atomic unit. Returns the allocated commit id, or -1 for an elided key. Re-entrant via SqliteDatabase.runInTransaction: joins the caller's transaction when there is one, else opens its own.
compact(bool dryRun) Stream<int>
Compact the commit log. If dryRun is true, yields each commit-id that WOULD be removed without performing the deletion. If false, performs the compaction and yields each commit-id as it is removed.
override
entriesCount() int
Total entry count. Used by operators / metrics; not on any hot path.
override
firstCommittedSequenceNumber() int?
Smallest commitId still retained in the log, or null if the log is empty. Pairs with lastCommittedSequenceNumber to expose the log's [floor, ceiling] to sync clients.
override
getLatestCommitEntry(String key) CommitEntry?
The latest CommitEntry for key, or null if key has never been committed.
override
getSize() int
Approximate on-disk size in bytes.
override
iterate({int? fromCommitId, bool where(CommitEntry)?}) Stream<CommitEntry>
Iterate every commit entry in commitId order. If fromCommitId is provided, yields only entries with commitId >= fromCommitId. If where is provided, only entries for which where(entry) returns true are yielded; the rest are silently skipped. Used by sync, by migration, and by anything that needs full-log traversal.
override
lastCommittedSequenceNumber() int?
Latest assigned commitId, or null if the log is empty.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeSync(String atKey) → void
Delete the commit-log row for atKey (expiry / skipCommit path). No counter bump. Re-entrant. An expired key must not be resurrectable by a sync client replaying an old commit entry.
replay(CommitEntry entry) Future<void>
Replay entry under its existing commitId WITHOUT firing change-event listeners. Used by the persistence migrator to copy commit-log content from one backend to another while preserving sync identity. Idempotent on (commitId, atKey, operation).
override
toString() String
A string representation of this object.
inherited

Operators

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