Expand description
Persistence layer for the incremental compiler.
Stores advisory build state scoped to one profile namespace. The database persists four categories of state:
- File metadata — Content hashes and source text, keyed by source path. Freshness is determined by file size and modification time; stale entries are transparently refreshed from disk.
- Object artifacts — Compiled object payloads, keyed by logical object identifier and content fingerprint.
- Typecheck artifacts — Per-object validation results (fingerprints, column schemas), used for incremental dirty detection.
- Project snapshot — Full compiled project graph for read-only consumers (LSP, explain).
All cached state is advisory. Missing, corrupt, or schema-incompatible entries are treated as cache misses and rebuilt from source. The compiler owns the schema version; a version mismatch triggers a full rebuild of the namespace-local database.
Structs§
- Alias
Visitor 🔒 - AST visitor that collects FROM-clause table aliases. Only direct table references; derived subqueries and table functions are skipped.
- Build
Artifact 🔒 - Compiled
Object 🔒Artifact Data - SQL fragments that together describe a compiled database object.
- Object
State 🔒Header - Column values to write into the
object_staterow, derived from aCompiledObjectArtifact. - Object
State 🔒Row - An object compilation artifact to be written to
object_state. - Project
Statements 🔒 - Prepared INSERT statements for
BuildArtifact::write_project.
Enums§
- Compiled
Object 🔒Artifact - A persisted compile artifact for one logical object.
Constants§
Functions§
- collect_
fragments 🔒 - db_err 🔒
- extract_
alias_ 🔒map - Extract alias → fully-qualified name map from a statement’s query body.
- file_
metadata_ 🔒signature - file_
read_ 🔒err - prepare_
delete 🔒 - prepare_
fragment_ 🔒insert - read_
and_ 🔒upsert_ file - Read the file at
path, compute its hash, and upsert the row intofile_state. Returns the hash and contents. - run_
execute 🔒 - statement_
cluster 🔒 - Extract the cluster name from a statement’s
IN CLUSTERclause, if present. - write_
fragments 🔒