Skip to main content

Module project

Module project 

Source
Expand description

Project compilation, graph assembly, and deployment analysis.

This module defines the compile contract for a Materialize project rooted on disk. The result of compilation is an ir::graph::Project.

Compilation has two behavioral layers:

  1. Object compilation — each logical object is discovered from source files, parsed, validated, and normalized independently. These object-local results are the unit of parallelism and the unit of persistent cache reuse.
  2. Graph assembly — the current object set is assembled into a compiled project and then into a dependency-aware project graph, where cross-object constraints and deployment ordering are enforced.

The project module is organized by compiler responsibility:

  • compiler — compile orchestration, object validation, incremental caching, and assembly
  • syntax — source-file discovery, parsed input structures, parser integration, profile variants, and variable substitution
  • resolve — name qualification, normalization, and lowering transforms
  • analysis — dependency extraction, topology, deployment snapshots, dirty propagation, and graph-wide validations
  • ir — semantic identifiers, compiled project IR, and dependency graph IR

plan_sync() is the canonical synchronous compiler entrypoint. It uses the incremental compiler in compiler to reuse persisted object artifacts across invocations. plan() is an async wrapper that runs this compile contract on a blocking thread pool.

The sibling modules in analysis/ operate on the assembled project graph to answer deployment questions such as which objects changed, which downstream objects must be restaged, and whether runtime cluster rules are satisfied.

Modules§

analysis 🔒
Analyses derived from compiled project state.
ast 🔒
Abstract syntax types shared across project compilation and graph analysis.
clusters 🔒
Cluster definition loading and validation.
compiler 🔒
Incremental project compiler.
error 🔒
Error types for Materialize project operations.
ir 🔒
Core semantic identifiers shared across the compiler.
network_policies 🔒
Network policy definition loading and validation.
resolve 🔒
Name resolution and lowering transforms.
roles 🔒
Role definition loading and validation.
syntax 🔒
Source-facing compiler inputs.

Structs§

SchemaQualifier
A (database_name, schema_name) pair identifying a schema within a project.

Functions§

plan 🔒
Async wrapper around plan_sync that runs the CPU-bound compiler on a blocking thread pool.
plan_sync 🔒
Compile a project root into a planned deployment representation.