logical.Datatypeno test imports ittype Data = { readonly items: readonly Item[]; readonly traces: readonly Trace[] };What can be asked.
The query algebra (0037-planning FR-020): a typed, pure and read-only question over the items, events, links and traces (select, filter by state, kind, label, assignee, severity and origin, join, order, limit). A proposed item is not counted unless the question says so, and a surface (the SQL relations, planctl query) is a projection of this and not a second definition.
import { runQuery } from "./query.ts";
// runQuery(data, { from: "items", where: { state: ["open"] }, order: { by: "title" }, limit: 10 })logical.Datatypeno test imports ittype Data = { readonly items: readonly Item[]; readonly traces: readonly Trace[] };What can be asked.
logical.ItemFiltertypeno test imports ittype ItemFilter = {
readonly state?: readonly StateKind[];
readonly kind?: readonly ItemKind[];
readonly label?: string;
readonly assignee?: string;
readonly severity?: readonly Severity[];
readonly origin?: readonly Origin[];
/** A proposed item is not counted unless this is true. */
readonly includeProposed?: boolean;
};A filter on items.
logical.ItemOrdertypeno test imports ittype ItemOrder = "id" | "title" | "state" | "severity" | "openedAt" | "updatedAt";The fields items are ordered by.
logical.Orderingtypeno test imports ittype Ordering = { readonly by: ItemOrder; readonly desc?: boolean };An ordering.
logical.Querytypeno test imports ittype Query =
| { readonly from: "items"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: numb… (565 characters)type Query =
| { readonly from: "items"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: number }
| { readonly from: "events"; readonly where?: ItemFilter; readonly type?: readonly EventType[]; readonly limit?: number }
| { readonly from: "links"; readonly where?: ItemFilter; readonly limit?: number }
| { readonly from: "traces"; readonly where?: ItemFilter; readonly source?: string; readonly limit?: number }
| { readonly from: "items-traces"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: number };A question.
logical.Rowtypeno test imports ittype Row =
| { readonly kind: "item"; readonly item: Item }
| { readonly kind: "event"; readonly event: ItemEvent }
| { readonly kind: "link"; readonly link: Link }
| { readonly kind: "trace"; readonly trace: Trace }
| { readonly kind: "item-trace"; readonly item: Item; readonly trace: Trace };What a question gives back.
logical.passesfunctionno test imports itfunction passes(item: Item, f: ItemFilter | undefined): booleanWhether an item passes a filter.
logical.runQueryfunctionno test imports itfunction runQuery(data: Data, q: Query): readonly Row[]The rows a question gives, in an order that is a function of the data and the question alone.
Datatypeno test imports ittype Data = { readonly items: readonly Item[]; readonly traces: readonly Trace[] };What can be asked.
ItemFiltertypeno test imports ittype ItemFilter = {
readonly state?: readonly StateKind[];
readonly kind?: readonly ItemKind[];
readonly label?: string;
readonly assignee?: string;
readonly severity?: readonly Severity[];
readonly origin?: readonly Origin[];
/** A proposed item is not counted unless this is true. */
readonly includeProposed?: boolean;
};A filter on items.
ItemOrdertypeno test imports ittype ItemOrder = "id" | "title" | "state" | "severity" | "openedAt" | "updatedAt";The fields items are ordered by.
Orderingtypeno test imports ittype Ordering = { readonly by: ItemOrder; readonly desc?: boolean };An ordering.
Querytypeno test imports ittype Query =
| { readonly from: "items"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: numb… (565 characters)type Query =
| { readonly from: "items"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: number }
| { readonly from: "events"; readonly where?: ItemFilter; readonly type?: readonly EventType[]; readonly limit?: number }
| { readonly from: "links"; readonly where?: ItemFilter; readonly limit?: number }
| { readonly from: "traces"; readonly where?: ItemFilter; readonly source?: string; readonly limit?: number }
| { readonly from: "items-traces"; readonly where?: ItemFilter; readonly order?: Ordering; readonly limit?: number };A question.
Rowtypeno test imports ittype Row =
| { readonly kind: "item"; readonly item: Item }
| { readonly kind: "event"; readonly event: ItemEvent }
| { readonly kind: "link"; readonly link: Link }
| { readonly kind: "trace"; readonly trace: Trace }
| { readonly kind: "item-trace"; readonly item: Item; readonly trace: Trace };What a question gives back.
passesfunctionno test imports itfunction passes(item: Item, f: ItemFilter | undefined): booleanWhether an item passes a filter.
runQueryfunctionno test imports itfunction runQuery(data: Data, q: Query): readonly Row[]The rows a question gives, in an order that is a function of the data and the question alone.