Skip to main content

run_sync

Function run_sync 

Source
pub async fn run_sync(
    repo_root: &Path,
    db_path: &Path,
    namespace: &str,
) -> Result<SyncReport>
Expand description

Rebuild db_path from .khive/kg/{entities,edges}.ndjson under repo_root.

The operation is atomic: the database is built in a .tmp sibling file and renamed over db_path only on success. A crash or error leaves the previous db_path intact.

namespace is applied to all imported records.

Returns a SyncReport on success, or an error if NDJSON parsing or SQLite upserts fail.