Skip to main content

compile_sync_with_stats

Function compile_sync_with_stats 

Source
fn compile_sync_with_stats<P: AsRef<Path>>(
    fs: &FileSystem,
    root: P,
    profile: Option<&str>,
    profile_suffix: Option<&str>,
    variables: &BTreeMap<String, String>,
) -> Result<(Project, CompileStats), ProjectError>
Expand description

Internal entry point that returns compile statistics alongside the project.

Runs the full incremental pipeline:

  1. Discover — walk models/ to find databases, schemas, objects, and mod files. Build the Discovery containing all descriptors and the database name map.
  2. Plan — fingerprint every object against the cached artifact store. Partition objects into cache hits and cache misses (parallel via rayon).
  3. Compile misses — parse, validate, and normalize each miss from source. Persist new artifacts back to the cache (parallel via rayon).
  4. Assemble — combine database/schema metadata with validated objects into a compiled::Project. Apply cross-database and cluster name rewrites if a profile suffix is active.
  5. Build graph — run cross-object validation, dependency extraction, and topological analysis to produce the final graph::Project.