fv-connect · FusionVault Conduit
fv-connect is how FusionVault reads and writes the systems its data lives in. It connects to a relational database, a SQLite file or a REST endpoint, reads rows with the caller's access-control filter pushed into the query so hidden rows never leave the source, writes transform outputs back with an atomic swap so readers never see a half-written table, and drives the incremental base-ingest scan that turns successive snapshots into a changelog.
Read a source with access control pushed down
use ;
use ;
# async
A row is Vec<(String, Value)> in the value dialect, so it
flows straight into pipelines. The secret never lives in the config: secret_env_var(name, key)
names the environment variable a vault stand-in resolves it from.
Write back with atomic promotion
use ;
# async
Rows land in a staging table first; the swap into place is a single transaction, so the previous good output stays current until the new one is complete.
Sources are a registry
Each connector type is a Source: what it can do (Caps), which scan leg drives it, and how it
reads and writes. Postgres, MySQL, SQLite and REST are registered at startup; a new one is one
register_source call, and every entry point dispatches through the registry.
use Arc;
use ;
# ;
#
#
register_source;
assert!;
The REST source needs no code at all: its options carry the URL, an optional recordsPath
into the response, and a fields map from output column to a value-dialect expression over each
record.
Incremental ingest
scan_source reads every snapshot newer than a checkpoint, diffs each against the last with
diff_snapshots, and emits property-level INSERT / UPDATE / DELETE changes to a Sink; it returns
the new checkpoint. SnapshotStore and Checkpoint are the on-disk landing for polled sources,
LandingSource wraps a fetch function into a scannable source, and fold_compacted_log turns a
keyed message log into the same snapshot shape. normalize_row applies a datasource binding's
label columns and property allow-list to each row.
Bindings, changelog diffs, compacted-log folds and row normalisation are each checked against the
published fv-contract conformance vectors, shared with
the TypeScript control plane.
Develop
&& &&
FV_PG_DSN=postgresql://app:app-secret@localhost:5432/shop
The SQLite and REST paths test in-process. Postgres and MySQL tests are #[ignore] and run
against a live database when their DSN variable is set.
Apache-2.0. Plain semver; tags vX.Y.Z at the published commit; see CHANGELOG.md.