Skip to main content

schema_core/
lib.rs

1//! The cross-cutting vocabulary for `flusso`.
2//!
3//! Every other crate produces or consumes these types. They are the canonical,
4//! already-validated shape of a search document and its building blocks,
5//! carrying no trace of the file format they were parsed from. The *assembled*
6//! deployment config (`Config`/`Index`/`Source`/the `Sink` enum) is a
7//! composition concern and lives a layer up in the `schema` crate, not here, so
8//! the backends can depend on this vocabulary without reaching the top-level
9//! config.
10//!
11//! - [`common`] holds the validated primitives — newtypes such as [`TableName`]
12//!   and [`ColumnName`] that enforce Postgres identifier rules at construction.
13//! - [`config`] holds the structures built from them: [`IndexSchema`],
14//!   [`Field`], [`Join`], [`Aggregate`], [`Filter`], [`IndexMapping`], and the rest.
15//! - [`traits`] defines the conversion the format crates implement —
16//!   [`ParseFrom`] (text into entities).
17//!
18//! Identifier types are built with [`nutype`]: they can only be constructed
19//! through `try_new`, so an invalid name never reaches the model.
20//!
21//! [`nutype`]: https://docs.rs/nutype
22
23pub mod common;
24pub mod config;
25pub mod traits;
26
27pub use common::*;
28pub use config::*;
29pub use traits::*;