neededByinstantoptionalBy when it is needed
Becomes the column needed_by of waiting.
Written at commons/data/models/operations/mod.ts:66
A precondition the work waits on, from whom, since when and by when it is needed: the waiting-on ledger, whose status is computed from its dates
Model operations. Written in commons/data/models/operations/mod.ts:59. Identified by waitingId.
neededByinstantoptionalBy when it is needed
Becomes the column needed_by of waiting.
Written at commons/data/models/operations/mod.ts:66
onWhomtextrequiredWho must give it
Becomes the column on_whom of waiting.
Written at commons/data/models/operations/mod.ts:64
resolvedAtinstantoptionalWhen it came
Becomes the column resolved_at of waiting.
Written at commons/data/models/operations/mod.ts:68
sinceinstantrequiredSince when it is waited on
Becomes the column since of waiting.
Written at commons/data/models/operations/mod.ts:65
statuscode of waitingStatusrequiredwaitingIdidentifierrequiredWhat identifies the wait
Becomes the column waiting_id of waiting.
Written at commons/data/models/operations/mod.ts:62
whattextrequiredWhat is waited on
Becomes the column what of waiting.
Written at commons/data/models/operations/mod.ts:63
Projects to the table waiting with the primary key waiting_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
needed_by | timestamp | true | attribute | waiting.neededBy |
on_whom | text | false | attribute | waiting.onWhom |
resolved_at | timestamp | true | attribute | waiting.resolvedAt |
since | timestamp | false | attribute | waiting.since |
status | text | false | attribute | waiting.status |
waiting_id | text | false | attribute | waiting.waitingId |
what | text | false | attribute | waiting.what |
CREATE TABLE IF NOT EXISTS "waiting" (
"waiting_id" VARCHAR NOT NULL PRIMARY KEY,
"what" VARCHAR NOT NULL,
"on_whom" VARCHAR NOT NULL,
"since" TIMESTAMPTZ NOT NULL,
"needed_by" TIMESTAMPTZ,
"status" VARCHAR NOT NULL,
"resolved_at" TIMESTAMPTZ,
CONSTRAINT "waiting_status_ck" CHECK ("status" IN ('open', 'resolved', 'cancelled'))
);CREATE TABLE IF NOT EXISTS "waiting" (
"waiting_id" TEXT NOT NULL PRIMARY KEY,
"what" TEXT NOT NULL,
"on_whom" TEXT NOT NULL,
"since" TIMESTAMPTZ NOT NULL,
"needed_by" TIMESTAMPTZ,
"status" TEXT NOT NULL,
"resolved_at" TIMESTAMPTZ,
CONSTRAINT "waiting_status_ck" CHECK ("status" IN ('open', 'resolved', 'cancelled'))
);CREATE TABLE IF NOT EXISTS "waiting" (
"waiting_id" TEXT NOT NULL PRIMARY KEY,
"what" TEXT NOT NULL,
"on_whom" TEXT NOT NULL,
"since" TEXT NOT NULL,
"needed_by" TEXT,
"status" TEXT NOT NULL,
"resolved_at" TEXT,
CONSTRAINT "waiting_status_ck" CHECK ("status" IN ('open', 'resolved', 'cancelled'))
);Read and written from TypeScript with the types the model gives: import { waiting } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/operations.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { waiting } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(waiting).select((s) => ({ waitingId: s.waiting.waitingId, what: s.waiting.what })).run(runner);