pub struct ModelDag {
pub graph: DiGraph<ModelNode, ()>,
pub node_map: HashMap<String, NodeIndex>,
}Expand description
Complete pipeline DAG with topological execution tiering and cycle detection.
Fields§
§graph: DiGraph<ModelNode, ()>§node_map: HashMap<String, NodeIndex>Implementations§
Source§impl ModelDag
impl ModelDag
pub fn new() -> Self
Sourcepub fn add_model(
&mut self,
name: impl Into<String>,
raw_sql: &str,
materialization: Materialization,
catalog_prefix: &str,
) -> Result<NodeIndex>
pub fn add_model( &mut self, name: impl Into<String>, raw_sql: &str, materialization: Materialization, catalog_prefix: &str, ) -> Result<NodeIndex>
Registers a raw model SQL definition into the DAG with a default Parquet format.
Sourcepub fn add_model_with_format(
&mut self,
name: impl Into<String>,
raw_sql: &str,
materialization: Materialization,
output_format: OutputFormat,
output_path: Option<String>,
catalog_prefix: &str,
) -> Result<NodeIndex>
pub fn add_model_with_format( &mut self, name: impl Into<String>, raw_sql: &str, materialization: Materialization, output_format: OutputFormat, output_path: Option<String>, catalog_prefix: &str, ) -> Result<NodeIndex>
Registers a raw model SQL definition with explicit OutputFormat and optional output path.
Sourcepub fn build_graph(&mut self) -> Result<()>
pub fn build_graph(&mut self) -> Result<()>
Resolves dependency edges between models and validates that there are no circular dependencies or layer boundary violations.
Sourcepub fn topological_sequence(&self) -> Result<Vec<ModelNode>>
pub fn topological_sequence(&self) -> Result<Vec<ModelNode>>
Computes a flat topologically sorted execution sequence.
Sourcepub fn execution_tiers(&self) -> Result<Vec<Vec<ModelNode>>>
pub fn execution_tiers(&self) -> Result<Vec<Vec<ModelNode>>>
Computes parallel execution tiers where all models in a tier can be run concurrently.
Sourcepub fn primary_source(node: &ModelNode) -> Option<(&str, &str)>
pub fn primary_source(node: &ModelNode) -> Option<(&str, &str)>
First source('ns','table') dependency, if any.
Sourcepub fn bronze_source_ident(node: &ModelNode) -> Option<(String, String)>
pub fn bronze_source_ident(node: &ModelNode) -> Option<(String, String)>
Resolve registration identity for a bronze-backed model.
Sourcepub fn validate_bronze_sources(
&self,
project_dir: &Path,
mode: BronzeCheckMode,
) -> Result<BronzeValidationReport>
pub fn validate_bronze_sources( &self, project_dir: &Path, mode: BronzeCheckMode, ) -> Result<BronzeValidationReport>
Compile-time bronze frontmatter / scan_path validation.
Off— no filesystem checksWarn— missing paths become warningsFail— missing paths become errors (report.has_errors())
Source§impl ModelDag
impl ModelDag
Sourcepub fn resolve_select(
&self,
select: Option<&str>,
mode: SelectMode,
) -> Result<HashSet<String>>
pub fn resolve_select( &self, select: Option<&str>, mode: SelectMode, ) -> Result<HashSet<String>>
Resolve which model names are in the selection.
Sourcepub fn subgraph(&self, keep: &HashSet<String>) -> Result<ModelDag>
pub fn subgraph(&self, keep: &HashSet<String>) -> Result<ModelDag>
Return a new DAG containing only keep models (must include all model deps).
Sourcepub fn apply_select(
&self,
select: Option<&str>,
mode: SelectMode,
) -> Result<ModelDag>
pub fn apply_select( &self, select: Option<&str>, mode: SelectMode, ) -> Result<ModelDag>
Apply --select and return a filtered DAG.
Sourcepub fn models_with_test_contract(&self) -> Result<Vec<String>>
pub fn models_with_test_contract(&self) -> Result<Vec<String>>
Names of models that declare a test contract (for default rbt test).