Added CRDT snapshotting

This commit is contained in:
Timmy
2026-06-29 20:11:52 +01:00
parent 3342d129c2
commit 4c965c73b2
6 changed files with 309 additions and 75 deletions
@@ -0,0 +1,9 @@
-- Stores a serialized CRDT state snapshot so startup can skip replaying
-- the full op log. Only the single most recent snapshot row is kept.
CREATE TABLE IF NOT EXISTS crdt_snapshot (
id INTEGER PRIMARY KEY CHECK (id = 1),
at_seq INTEGER NOT NULL,
max_rowid INTEGER NOT NULL,
state_json TEXT NOT NULL,
created_at TEXT NOT NULL
);