Skip to main content

Module project

Module project 

Source
Expand description

Event replay → SQLite projection pipeline.

The Projector replays events from the TSJSON event log and upserts the resulting state into the SQLite projection database. It handles all 11 event types and supports both incremental (single-event) and full rebuild modes.

§Deduplication

Events are deduplicated by event_hash. When a duplicate hash is encountered (e.g. from git merge duplicating lines in shard files), the event is silently skipped.

§Cursor

After projecting a batch, the caller can persist the byte offset and last event hash via super::query::update_projection_cursor for incremental replay on next startup.

Structs§

ProjectionStats
Statistics returned after a projection run.
Projector
Replays events into the SQLite projection.

Constants§

PROJECTED_EVENTS_DDL
SQL to create the projected_events tracking table.

Functions§

clear_projection
Drop all projection data for a full rebuild.
ensure_tracking_table
Ensure the projected_events tracking table exists.