Skip to main content

brink_db/
lib.rs

1//! Incremental project database for inkle's ink narrative scripting language.
2//!
3//! `ProjectDb` is the query-shaped project model (scripting-substrate spec
4//! §3): file texts are salsa inputs, and every pipeline stage — parse, HIR,
5//! include graph, symbol index, resolution, signatures, analysis, LIR,
6//! `StoryData` — is a memoized tracked query with dependency tracking and
7//! early cutoff. This crate is the only one that knows salsa exists; stage
8//! crates (`brink-syntax`, `brink-ir`, `brink-analyzer`,
9//! `brink-codegen-inkb`) export plain functions the queries call. The
10//! compiler (one-shot), LSP, and IDE all use `ProjectDb` as their project
11//! model.
12
13mod db;
14mod determinism;
15mod include_graph;
16#[cfg(feature = "memory-introspection")]
17mod memory;
18mod modules;
19mod queries;
20
21pub use brink_analyzer::{
22    BodyTypes, EffectAtoms, EffectRow, InferenceResult, InferredSig, Sig, Ty,
23};
24pub use brink_ir::FileId;
25pub use db::{ProjectDb, compute_relative_path, resolve_include_path};
26#[cfg(feature = "memory-introspection")]
27pub use memory::{IngredientKind, IngredientMemory};
28pub use queries::{
29    CompileProduct, FileDiagnostics, LirProduct, ResolvedProject, has_recognized_source_extension,
30    is_native_source_path, partition_diagnostics,
31};
32// Extracted to the `brink-source-tree` L0 leaf (decision-log 2026-07-23,
33// issue #1323 ruling on #1325) so `brink-project-config` can depend on the
34// seam without a cycle through this crate. Re-exported here so
35// `brink_db::SourceTree`/`brink_db::InMemory` keep resolving for existing
36// consumers (`brink-driver`'s `discover_native` among them) unchanged.
37pub use brink_source_tree::{InMemory, SourceTree};