SqliteSchema class

The per-atSign SQLite schema — a stable interchange contract. One database per atSign; every store (keystore, commit log, notifications, access log) lives in the same atsign.db file so a value write and its commit entry can share one transaction.

The DDL, PRAGMAs, and contractVersion here are the canonical definition of that contract.

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

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

apply(Database db) → void
Applies PRAGMAs, creates every table/index (idempotent), seeds the counters, and reconciles user_version. Safe to call on an existing database (nothing is dropped).

Constants

accessLog → const String
Insert-only connection/verb audit feeding the stats verbs. seq is the implicit rowid alias (insertion order == id order).
accessLogIndexes → const List<String>
atData → const String
One row per live atKey. Deletes remove the row (sync-visible deletion state lives in commitLog, not here as a tombstone). metadata is the canonical AtMetaData JSON (the wire llookup:all form); expires_at/available_at/refresh_at are indexed extracts of the same-named derived metadata fields (epoch millis, UTC).
atDataIndexes → const List<String>
commitLog → const String
One row per atKey, newest-wins: a new commit for an atKey replaces that atKey's row (the canonical CommitLogKeyStore collapse — the log answers "each key's latest commit", not the history).
commitLogIndexes → const List<String>
contractVersion → const int
PRAGMA user_version. A reader hard-fails on a database whose stored version is HIGHER than this (it cannot know the newer shape) and migrates-forward from a lower one.
counters → const String
Monotonic allocators. last_commit_id is bumped in the same transaction as each synced write, giving a dense, gapless commit id per database. (A MAX(commit_log.commit_id) allocator is unsafe: expiry purges a key's commit row and could reissue the max id.)
notificationIndexes → const List<String>
notifications → const String
Durable notification delivery queue + inbox. payload is the canonical AtNotification JSON; the other columns are indexed extracts for the three query shapes (since-time monitor scans, startup re-enqueue of queued, expiry sweep).
pragmas → const List<String>
Open-time PRAGMAs. WAL + synchronous=NORMAL survives process kill (only power loss can drop the WAL tail); both servers tolerate opening a database left in either journal mode.
seedCounters → const String