IF Commons GitHub

logical/query

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0006-evidence-capture-query FR-001, 0006-evidence-capture-query FR-002, 0006-evidence-capture-query FR-003

Questions of the journal in SQL (commons evidence-capture 0006-evidence-capture-query): the entries of the journal and the last look at each asset, 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 entries it reads, so that the assets that changed most, the assets not looked at for a day and the failures of a kind are one line of SQL each.

import { queryJournal } from "@intellectual-frontiers/evidence-capture/logical";
// queryJournal(entries, "SELECT asset, changes FROM assets ORDER BY changes DESC LIMIT 5");

Source: commons/evidence-capture/src/logical/query.ts

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

logical.QueryOptionstypeno test imports it
type QueryOptions = { readonly limit?: number; readonly params?: readonly Value[] };

What may be given to a question.

logical.Answertypeno test imports it
type Answer = { readonly columns: readonly string[]; readonly rows: readonly (readonly Value[])[]; readonly truncated: boolean };

What a question gives.

logical.journalCatalogfunctionno test imports it
function journalCatalog(): Catalog

The catalog of the relations.

logical.journalRelationsfunctionno test imports it
function journalRelations(entries: readonly (Document & { readonly seq: number; readonly previous: string; readonly type: string; readonly subject: string; readonly evidence: string; readonly digest: string; } & {})[]): Readonly<Record<string, Table>>

The relations of the entries: journal is each entry (its subject is the asset), assets the entries of each asset counted, its last look and its first.

logical.queryJournalfunctionno test imports it
function queryJournal(entries: readonly (Document & { readonly seq: number; readonly previous: string; readonly type: string; readonly subject: string; readonly evidence: string; readonly digest: string; } & {})[], sql: string, options?: QueryOptions): Result<Answer, string>

The answer to one read-only question over the journal, or why it is refused (with its place) or cannot be answered.

QueryOptionstypeno test imports it
type QueryOptions = { readonly limit?: number; readonly params?: readonly Value[] };

What may be given to a question.

Answertypeno test imports it
type Answer = { readonly columns: readonly string[]; readonly rows: readonly (readonly Value[])[]; readonly truncated: boolean };

What a question gives.

journalCatalogfunctionno test imports it
function journalCatalog(): Catalog

The catalog of the relations.

journalRelationsfunctionno test imports it
function journalRelations(entries: readonly (Document & { readonly seq: number; readonly previous: string; readonly type: string; readonly subject: string; readonly evidence: string; readonly digest: string; } & {})[]): Readonly<Record<string, Table>>

The relations of the entries: journal is each entry (its subject is the asset), assets the entries of each asset counted, its last look and its first.

queryJournalfunctionno test imports it
function queryJournal(entries: readonly (Document & { readonly seq: number; readonly previous: string; readonly type: string; readonly subject: string; readonly evidence: string; readonly digest: string; } & {})[], sql: string, options?: QueryOptions): Result<Answer, string>

The answer to one read-only question over the journal, or why it is refused (with its place) or cannot be answered.

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