IF Commons GitHub

host/query

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0002-mizan-query FR-004

A library's trace, read for a question (commons mizan 0002-mizan-query FR-004): the findings of the trace of the sources and tests at root to its specifications, the baseline trace.baseline.txt and the specifications, answered with queryTrace. A command line --root DIR "SELECT ..." prints the answer as a table; it writes nothing.

bun tools/query.ts "SELECT rule, count(*) AS n FROM findings GROUP BY rule"

Source: commons/mizan/src/host/query.ts

1 of 3 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

traceRecordsfunctionno test imports it
function traceRecords(root: string): Promise<TraceRecords>

The records of the library at root: its findings, its baseline and its specifications (in spec-kit/specs).

queryLibraryfunction
function queryLibrary(root: string, sql: string, options?: { readonly limit?: number | undefined; }): Promise<Result<Answer, string>>

One question of the library at root.

Imported by 4 tests of the run (4 passed, 0 failed): the library's results

tableTextfunctionno test imports it
function tableText(answer: Answer): string

The rows as aligned text: a header, then a row for each.

Titles, headings, exports, tables, columns and requirements. Esc closes.