1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Load a `flusso` configuration into a validated model.
//!
//! This is the front door to the configuration layer. [`load`] takes the path
//! to a `flusso.toml`, reads the source and sinks from it, resolves and parses
//! every index schema the file references, and hands back a single [`Config`].
//!
//! The format-specific crates (`schema-config-toml`, `schema-index-yaml`) and
//! the core model (`schema-core`) sit underneath. Downstream code depends only
//! on this crate and reaches the core types through its re-exports.
//!
//! # Example
//!
//! ```no_run
//! let config = schema::load("flusso.toml")?;
//!
//! for (name, index) in &config.indexes {
//! println!("{name}: table {} ({} fields)", index.schema.table, index.schema.fields.len());
//! }
//! # Ok::<(), schema::LoadError>(())
//! ```
// `serde_json` / `serde_yaml` are dev-dependencies used only by the
// `schema_drift` integration test; allow them to look unused in the lib's own
// test build (see `tests/schema_drift.rs`).
pub use ;
pub use ;
pub use ;
// Re-export the canonical schema vocabulary so downstream crates depend only on
// `schema` rather than reaching into the sub-crates directly. The assembled
// `Config` family (above) lives in this crate; everything else — the
// identifiers, `IndexSchema`, `IndexMapping`, `FailurePolicy`, the per-sink
// configs — is the cross-cutting vocabulary from `schema-core`.
pub use *;
// The embedded editor-assist JSON Schemas, owned by the format crates that
// define each file's shape. Exposed here so the CLI (and any consumer) reaches
// them through `schema`.
pub use CONFIG_SCHEMA;
pub use INDEX_SCHEMA;