KeptRuntypetype KeptRun = { readonly record: QualityRecord; readonly day: string; readonly grade: string };A run as it is kept: its record, the day of its file and the grade the branch gives it.
Questions of the runs kept as evidence in SQL (commons quality 0002-quality-query): the runs and the cases of the records, made into relations, and a read-only SQL answered over them with the SQL language library (its guard judges that the text is one read and binds it to the catalog, its engine answers). Pure: it is given the records it reads, so that the flaky test, the slowest suite and the requirement with no passing case are each one line of SQL.
import { queryRuns } from "@intellectual-frontiers/quality/query";
// queryRuns(runs, "SELECT name, count(*) AS n FROM cases WHERE outcome = 'failed' GROUP BY name ORDER BY n DESC LIMIT 5");KeptRuntypetype KeptRun = { readonly record: QualityRecord; readonly day: string; readonly grade: string };A run as it is kept: its record, the day of its file and the grade the branch gives it.
QueryOptionstypeno test imports ittype QueryOptions = { readonly limit?: number; readonly params?: readonly Value[] };What may be given to a question.
Answertypeno test imports ittype Answer = { readonly columns: readonly string[]; readonly rows: readonly (readonly Value[])[]; readonly truncated: boolean };What a question gives.
qualityCatalogfunctionfunction qualityCatalog(): CatalogThe catalog of the relations.
qualityRelationsfunctionfunction qualityRelations(runs: readonly KeptRun[]): Readonly<Record<string, Table>>The relations of the runs: a case lasts from its start to its end (nanoseconds in the record), in milliseconds.
queryRunsfunctionfunction queryRuns(runs: readonly KeptRun[], sql: string, options?: QueryOptions): Result<Answer, string>The answer to one read-only question over the runs, or why it is refused (with its place) or cannot be answered.