SqliteDatabase class

A single per-atSign SQLite database file. All four stores for an atSign (keystore, commit log, notification keystore, access log) share one instance — one open connection to one atsign.db — so a value write and its commit-log row commit atomically in one transaction.

sqlite3's API is synchronous; the store methods wrap these calls in Future-returning signatures to satisfy the async interface. A call blocks the isolate for the duration of the file I/O (the same tradeoff Hive's synchronous box operations make).

Properties

atSign String
The atSign this database belongs to.
final
hashCode int
The hash code for this object.
no setterinherited
inTransaction bool
true while a runInTransaction body is executing.
no setter
path String
Absolute or relative path to the .db file.
final
raw → Database
The underlying sqlite3 handle. Stores use it for select / execute / prepare. Prefer routing mutations through runInTransaction.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → void
Drops all rows from every table and re-seeds the counter, keeping the connection open. Backs AtPersistenceBundle.clear for cheap per-test isolation.
close() → void
Closes the connection. Idempotent-safe for the bundle's close path (callers must not use the context afterwards).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
runInTransaction<T>(T body()) → T
Runs body inside a single transaction. Re-entrant: a nested call joins the outer transaction rather than starting its own, and a rollback anywhere aborts the whole outermost transaction. On any thrown error the (outermost) transaction rolls back and the error propagates.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

open(String atSign, String dbPath) SqliteDatabase
Opens (creating parent directories and the file if needed) the database at dbPath, applies SqliteSchema, and returns the context.