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())
Sourcepub fn validate_bronze_sources_with_roots(
&self,
project_dir: &Path,
mode: BronzeCheckMode,
roots: &HashMap<String, String>,
) -> Result<BronzeValidationReport>
pub fn validate_bronze_sources_with_roots( &self, project_dir: &Path, mode: BronzeCheckMode, roots: &HashMap<String, String>, ) -> Result<BronzeValidationReport>
Compile-time bronze checks with project roots: for $name path templates.
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).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ModelDag
impl RefUnwindSafe for ModelDag
impl Send for ModelDag
impl Sync for ModelDag
impl Unpin for ModelDag
impl UnsafeUnpin for ModelDag
impl UnwindSafe for ModelDag
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for T
impl<T> Downcast for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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