IF Commons GitHub

limit

concept

A certificate, key, quota, licence or agreement that runs out or fills, with when and who renews it: the inventory of what will stop the platform if nobody acts

Model operations. Written in commons/data/models/operations/mod.ts:94. Identified by limitId.

Governance: attributes

expiresAtinstantoptional

When it runs out

Becomes the column expires_at of limit.

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

kindcode of limitKindrequired

What kind it is

Becomes the column kind of limit.

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

limitIdidentifierrequired

What identifies the limit

Becomes the column limit_id of limit.

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

nametextrequired

What it is

Becomes the column name of limit.

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

ownertextrequired

Who renews it

Becomes the column owner of limit.

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

renewalLeadDaysintegerrequired

How many days before it runs out someone must act

Becomes the column renewal_lead_days of limit.

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

Logical: the table

Projects to the table limit with the primary key limit_id.

ColumnTypeNullRoleFrom
expires_attimestamptrueattributelimit.expiresAt
kindtextfalseattributelimit.kind
limit_idtextfalseattributelimit.limitId
nametextfalseattributelimit.name
ownertextfalseattributelimit.owner
renewal_lead_daysintegerfalseattributelimit.renewalLeadDays

Physical: SQL

CREATE TABLE IF NOT EXISTS "limit" (
    "limit_id" VARCHAR NOT NULL PRIMARY KEY,
    "name" VARCHAR NOT NULL,
    "kind" VARCHAR NOT NULL,
    "expires_at" TIMESTAMPTZ,
    "owner" VARCHAR NOT NULL,
    "renewal_lead_days" INTEGER NOT NULL,
    CONSTRAINT "limit_kind_ck" CHECK ("kind" IN ('certificate', 'credential', 'quota', 'license', 'agreement'))
);

Physical: the typed table

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

const rows = await from(limit).select((s) => ({ limitId: s.limit.limitId, name: s.limit.name })).run(runner);

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