query: In addition to terms, whet does Unison Programming Language store in sqlite
date: 2025-Arp-25 2012Unison’s SQLite-based codebase stores several key elements beyond just code definitions (terms):
Abstract syntax trees (ASTs)
Code is stored in compiled form as syntax trees rather than text, with each definition content-addressed by its AST hash
Type information
The exact type of every definition is permanently stored alongside its AST, forming part of its identity
Metadata and naming
Human-readable names, documentation, and other metadata are stored separately from the code definitions themselves
Dependency graphs
Relationships between definitions are tracked, enabling perfect incremental compilation and dependency management
Compilation artifacts
Fully type-checked and compiled definitions persist in the database, eliminating redundant compilation
Persistent values
Any serializable value (including functions) can be stored directly in the codebase through Unison’s durable storage system
The SQLite database serves as a unified repository for all codebase elements, maintaining strong typing throughout and enabling features like fearless refactoring through content addressing . This architecture replaces traditional file-based code storage with a structured, queryable database containing both code and its associated metadata.