Skip to main content

run

Function run 

Source
pub(crate) fn run(
    directory: &Path,
    profile: &str,
    profile_suffix: Option<&str>,
    variables: &BTreeMap<String, String>,
    project: &Project,
    external_types: Types,
) -> Result<(Types, TypecheckStats), TypeCheckError>
Expand description

Full-typecheck entrypoint with incremental reuse.

Runs three phases:

  1. Build the base catalog (serial): seeds builtins, namespaces, external types, and all non-typechecked project objects.
  2. Run the DAG executor (parallel): each view/MV is a node. A node either re-typechecks (when its file or any upstream output changed) or returns its cached column schema directly. Dependents only re-typecheck when at least one upstream dep was schema-changed, which keeps a leaf edit that doesn’t change the leaf’s output schema from cascading.
  3. Persist newly-validated columns to SQLite. Failed and blocked objects keep their last successful row in the cache.

Returns the merged Types covering validated columns, base columns (tables/sources/etc.), and external types.lock entries, plus stats describing how much work the incremental layer skipped.