Skip to main content

Module build_artifact

Module build_artifact 

Source
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§

AliasVisitor 🔒
AST visitor that collects FROM-clause table aliases. Only direct table references; derived subqueries and table functions are skipped.
BuildArtifact 🔒
CompiledObjectArtifactData 🔒
SQL fragments that together describe a compiled database object.
ObjectStateHeader 🔒
Column values to write into the object_state row, derived from a CompiledObjectArtifact.
ObjectStateRow 🔒
An object compilation artifact to be written to object_state.
ProjectStatements 🔒
Prepared INSERT statements for BuildArtifact::write_project.

Enums§

CompiledObjectArtifact 🔒
A persisted compile artifact for one logical object.

Constants§

FILE_STATE_UPSERT 🔒
OBJECT_STATE_TABLE 🔒
TYPECHECK_COLUMNS_TABLE 🔒
TYPECHECK_OBJECTS_TABLE 🔒

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 into file_state. Returns the hash and contents.
run_execute 🔒
statement_cluster 🔒
Extract the cluster name from a statement’s IN CLUSTER clause, if present.
write_fragments 🔒