Skip to main content

check_incremental_safety

Function check_incremental_safety 

Source
pub fn check_incremental_safety(
    db: &Connection,
    events_dir: &Path,
) -> Result<(), String>
Expand description

Check if incremental apply is safe or if full rebuild is needed.

Checks:

  1. Schema version matches LATEST_SCHEMA_VERSION
  2. projected_events tracking table exists
  3. Sealed shard manifests are intact (file sizes match)

Returns Ok(()) if incremental is safe, Err(reason) with a human-readable reason string if a full rebuild is needed.

ยงErrors

Returns an error string describing why incremental rebuild is unsafe (schema mismatch, missing tracking table, or shard corruption).