IF Commons GitHub

workloadStatement

concept

A read-only statement of a workload with the number of rows and the hash of the rows it gave when it was recorded, to be replayed and compared

Model operations. Written in commons/data/models/operations/mod.ts:148. Identified by workloadStatementId.

Governance: attributes

baselineHashtextrequired

The SHA-256 of the rows it gave

Becomes the column baseline_hash of workload_statement.

Written at commons/data/models/operations/mod.ts:148

baselineRowsintegerrequired

How many rows it gave

Becomes the column baseline_rows of workload_statement.

Written at commons/data/models/operations/mod.ts:148

statementtextrequired

The statement, a single select

Becomes the column statement of workload_statement.

Written at commons/data/models/operations/mod.ts:148

workloadStatementIdidentifierrequired

What identifies the statement

Becomes the column workload_statement_id of workload_statement.

Written at commons/data/models/operations/mod.ts:148

Governance: relationships

workloadone

The workload it belongs to To workload. Written at commons/data/models/operations/mod.ts:148

Logical: the table

Projects to the table workload_statement with the primary key workload_statement_id.

ColumnTypeNullRoleFrom
baseline_hashtextfalseattributeworkloadStatement.baselineHash
baseline_rowsintegerfalseattributeworkloadStatement.baselineRows
statementtextfalseattributeworkloadStatement.statement
workload_idtextfalsereferenceworkloadStatement.workload
workload_statement_idtextfalseattributeworkloadStatement.workloadStatementId

Physical: SQL

CREATE TABLE IF NOT EXISTS "workload_statement" (
    "workload_statement_id" VARCHAR NOT NULL PRIMARY KEY,
    "statement" VARCHAR NOT NULL,
    "baseline_rows" INTEGER NOT NULL,
    "baseline_hash" VARCHAR NOT NULL,
    "workload_id" VARCHAR NOT NULL,
    CONSTRAINT "workload_statement_workload_id_fk" FOREIGN KEY ("workload_id") REFERENCES "workload" ("workload_id")
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { workloadStatement } 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 { workloadStatement } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(workloadStatement).select((s) => ({ workloadStatementId: s.workloadStatement.workloadStatementId, statement: s.workloadStatement.statement })).run(runner);

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