pub fn incremental_apply(
events_dir: &Path,
db_path: &Path,
force_full: bool,
) -> Result<ApplyReport>Expand description
Apply only events newer than the high-water mark to the projection.
Steps:
- Open (or try to open) the projection database.
- Read the projection cursor (byte offset + last event hash).
- Run safety checks — schema version, cursor validity, manifest integrity.
- If any check fails, fall back to a full rebuild.
- Otherwise, read shard content from the cursor byte offset onward.
- Parse and project only the new events.
- Update the cursor.
§Arguments
events_dir— Path to.bones/events/(the shard directory)db_path— Path to.bones/bones.db(theSQLiteprojection file)force_full— Iftrue, skip incremental and always do a full rebuild (bn admin rebuild --full).
§Errors
Returns an error if reading shards, parsing events, or projection fails.