counters constant

String const counters

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.)

Implementation

static const String counters = '''
CREATE TABLE IF NOT EXISTS counters (
name  TEXT PRIMARY KEY NOT NULL,
value INTEGER NOT NULL
) WITHOUT ROWID;
''';