pub struct SyntheticModel {
pub schema_ref: Option<String>,
pub version: u32,
pub kind: ModelKind,
pub imports: Vec<PathBuf>,
pub source: Option<SourceModel>,
pub defaults: ModelDefaults,
pub seed: Option<u64>,
pub output: OutputModel,
pub tables: BTreeMap<String, TableModel>,
pub profiles: BTreeMap<String, ProfileMetadata>,
}Expand description
A complete, self-contained synthetic data model.
Fields§
§schema_ref: Option<String>Editor-only schema pointer (e.g. # yaml-language-server: $schema=...
promoted into the document body, or a literal $schema: key). Purely
documentation metadata: recognized so an editor-annotated document
doesn’t trip deny_unknown_fields, never read by the parser.
version: u32§kind: ModelKind§imports: Vec<PathBuf>§source: Option<SourceModel>§defaults: ModelDefaults§seed: Option<u64>§output: OutputModel§tables: BTreeMap<String, TableModel>§profiles: BTreeMap<String, ProfileMetadata>Implementations§
Source§impl SyntheticModel
impl SyntheticModel
Sourcepub const SOURCE_LITERAL_GENERATORS: &'static [&'static str]
pub const SOURCE_LITERAL_GENERATORS: &'static [&'static str]
Generator kinds that persist literal values drawn from the source dump. A rule using one of these replays real observed values, so it must raise the conservative source-derived safety notice.
Sourcepub fn source_value_uses(&self) -> Vec<SourceValueUse>
pub fn source_value_uses(&self) -> Vec<SourceValueUse>
Scan every explicit and inferred rule for source-derived literal uses.
This never returns the literal values themselves — only where they live
and what kind of rule carries them — so the result is safe to print or
serialize into a JSON report. Categorical/constant/observed-sample
generators, source DEFAULTs a column defers to, and verbatim CHECK
constraints all count.
Sourcepub fn freeze_row_counts(
&mut self,
resolved: &BTreeMap<String, u64>,
family_children: &HashSet<String>,
)
pub fn freeze_row_counts( &mut self, resolved: &BTreeMap<String, u64>, family_children: &HashSet<String>, )
Rewrite each table’s rows count to the resolved value from a compiled
plan. Already-authoritative fixed/observed counts keep their kind;
derived scale/relation.children policies become fixed so a reload
cannot derive a different count, except for named relation children whose
distribution is still consumed by a cross-table family planner.
An observed table stays kind: observed with a frozen integer count,
which is what --emit-config needs for a self-contained model that
reproduces the same row counts on reload without re-passing volume
flags. Tables absent from resolved are left untouched.
Trait Implementations§
Source§impl Clone for SyntheticModel
impl Clone for SyntheticModel
Source§fn clone(&self) -> SyntheticModel
fn clone(&self) -> SyntheticModel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SyntheticModel
impl Debug for SyntheticModel
Source§impl<'de> Deserialize<'de> for SyntheticModel
impl<'de> Deserialize<'de> for SyntheticModel
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SyntheticModel
impl JsonSchema for SyntheticModel
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for SyntheticModel
impl RefUnwindSafe for SyntheticModel
impl Send for SyntheticModel
impl Sync for SyntheticModel
impl Unpin for SyntheticModel
impl UnsafeUnpin for SyntheticModel
impl UnwindSafe for SyntheticModel
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more