dsl block (dsl sqlite(schema: app) { … } eod)Open and answer this issue on GitHub.
language, libraries, ready · opened 2026-09-30 · updated 2026-10-06 · 1 comment
Step 2 of ADR-143 §5. A dsl block takes build-time arguments, named, no ;, resolved from comptime values. The driver’s grammar then reads the schema with its own DDL grammar and refuses a missing column at the query.
Open question that decides the spelling (on docs/open-decisions.md): how a schema is bound while the program is built. ADR-143 D3 and Part III 17.1 write let app = comptime asset("schema.sql"), which the language’s own rules refuse (a let is a statement; a build-time value is declared comptime NAME: T = …, Part II 7, ADR-116). Recommendation: comptime APP: db::Schema = asset("schema.sql").
comptime APP = asset("schema.sql") (ADR-287 D20)let app = comptime asset("schema.sql") is refused twice. At item level: Didn’t expect let here. In a body: Expected expression here, but found comptime.comptime APP = asset("schema.sql") lowers, at item level and in a body, and so does a lowercase name.comptime as an expression beside it;comptime as an expression replacing the declaration form.comptime stays on the left, on the name, as const/constexpr are written elsewhere. A function is never marked; whether it may run at build time is read off its ledger (ADR-287 D13, D14). The expression form would add a build-time value without a name, and a name is what ADR-299 D11 identifies a schema by.db::Schema or text) is left to the step that builds sqlite::open (ADR-299 D9, §6).comptime. It has its own issue, linked below.779b9e8)comptime APP = asset("schema.sql") and schema: APP.comptime marks the name and is not an expression.open-decisions.md.dsl block’s build-time arguments)dsl sqlite(schema: APP) { … } eod parses: named arguments in parentheses after the grammar’s name, no ; (ADR-299 D3, ADR-133).comptime of the surrounding scope (item level or the body). A name that is not a comptime, for example a let, is refused at the block.APP reaches the grammar with the schema’s text;let s = "…"; dsl sqlite(schema: s) is refused;APP share one schema (D11).Generated by Claude Code