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
statsverbs.seqis 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).
metadatais the canonicalAtMetaDataJSON (the wirellookup:allform);expires_at/available_at/refresh_atare 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
CommitLogKeyStorecollapse — 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_idis bumped in the same transaction as each synced write, giving a dense, gapless commit id per database. (AMAX(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.
payloadis the canonicalAtNotificationJSON; the other columns are indexed extracts for the three query shapes (since-time monitor scans, startup re-enqueue ofqueued, 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