batchStageIdidentifierrequiredWhat identifies the count
Becomes the column batch_stage_id of batch_stage.
Written at commons/data/models/flow/mod.ts:176
How many entities of a batch a stage confirmed: a step of the funnel from the manifest to what was accepted
Model flow. Written in commons/data/models/flow/mod.ts:176. Identified by batchStageId.
batchStageIdidentifierrequiredWhat identifies the count
Becomes the column batch_stage_id of batch_stage.
Written at commons/data/models/flow/mod.ts:176
entitiesintegerrequiredHow many it confirmed
Becomes the column entities of batch_stage.
Written at commons/data/models/flow/mod.ts:176
stagecode of stagerequiredmanifestoneThe batch To manifest. Written at commons/data/models/flow/mod.ts:176
Projects to the table batch_stage with the primary key batch_stage_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
batch_stage_id | text | false | attribute | batchStage.batchStageId |
entities | integer | false | attribute | batchStage.entities |
manifest_id | text | false | reference | batchStage.manifest |
stage | text | false | attribute | batchStage.stage |
CREATE TABLE IF NOT EXISTS "batch_stage" (
"batch_stage_id" VARCHAR NOT NULL PRIMARY KEY,
"stage" VARCHAR NOT NULL,
"entities" INTEGER NOT NULL,
"manifest_id" VARCHAR NOT NULL,
CONSTRAINT "batch_stage_manifest_id_fk" FOREIGN KEY ("manifest_id") REFERENCES "manifest" ("manifest_id"),
CONSTRAINT "batch_stage_manifest_id_stage_uq" UNIQUE ("manifest_id", "stage"),
CONSTRAINT "batch_stage_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);CREATE TABLE IF NOT EXISTS "batch_stage" (
"batch_stage_id" TEXT NOT NULL PRIMARY KEY,
"stage" TEXT NOT NULL,
"entities" INTEGER NOT NULL,
"manifest_id" TEXT NOT NULL,
CONSTRAINT "batch_stage_manifest_id_fk" FOREIGN KEY ("manifest_id") REFERENCES "manifest" ("manifest_id"),
CONSTRAINT "batch_stage_manifest_id_stage_uq" UNIQUE ("manifest_id", "stage"),
CONSTRAINT "batch_stage_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);CREATE TABLE IF NOT EXISTS "batch_stage" (
"batch_stage_id" TEXT NOT NULL PRIMARY KEY,
"stage" TEXT NOT NULL,
"entities" INTEGER NOT NULL,
"manifest_id" TEXT NOT NULL,
CONSTRAINT "batch_stage_manifest_id_fk" FOREIGN KEY ("manifest_id") REFERENCES "manifest" ("manifest_id"),
CONSTRAINT "batch_stage_manifest_id_stage_uq" UNIQUE ("manifest_id", "stage"),
CONSTRAINT "batch_stage_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);Read and written from TypeScript with the types the model gives: import { batchStage } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/flow.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { batchStage } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(batchStage).select((s) => ({ batchStageId: s.batchStage.batchStageId, stage: s.batchStage.stage })).run(runner);