entitlementIdidentifierrequiredWhat identifies the entitlement, made by the application
Becomes the column entitlement_id of entitlement.
Written at commons/data/models/identity-access/concepts.ts:123
What a tenant may use, as distinct from what a principal may do
Model identityAccess. Written in commons/data/models/identity-access/concepts.ts:120. Identified by entitlementId.
entitlementIdidentifierrequiredWhat identifies the entitlement, made by the application
Becomes the column entitlement_id of entitlement.
Written at commons/data/models/identity-access/concepts.ts:123
featureKeytextrequiredThe feature the tenant may use
Becomes the column feature_key of entitlement.
Written at commons/data/models/identity-access/concepts.ts:124
limitValueintegeroptionalHow much of it, where it is limited
Becomes the column limit_value of entitlement.
Written at commons/data/models/identity-access/concepts.ts:125
sourcecode of entitlementSourcerequiredWhere it comes from
Becomes the column entitlement_source_code of entitlement.
Written at commons/data/models/identity-access/concepts.ts:128
validFrominstantrequiredWhen it starts
Becomes the column valid_from of entitlement.
Written at commons/data/models/identity-access/concepts.ts:126
validToinstantoptionalWhen it ends, where it does
Becomes the column valid_to of entitlement.
Written at commons/data/models/identity-access/concepts.ts:127
tenantoneThe tenant To tenant. Written at commons/data/models/identity-access/concepts.ts:120
Projects to the table entitlement with the primary key entitlement_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
entitlement_id | text | false | attribute | entitlement.entitlementId |
entitlement_source_code | text | false | reference | entitlement.source |
feature_key | text | false | attribute | entitlement.featureKey |
limit_value | integer | true | attribute | entitlement.limitValue |
tenant_id | text | false | reference | entitlement.tenant |
valid_from | timestamp | false | attribute | entitlement.validFrom |
valid_to | timestamp | true | attribute | entitlement.validTo |
CREATE TABLE IF NOT EXISTS "entitlement" (
"entitlement_id" VARCHAR NOT NULL PRIMARY KEY,
"feature_key" VARCHAR NOT NULL,
"limit_value" INTEGER,
"valid_from" TIMESTAMPTZ NOT NULL,
"valid_to" TIMESTAMPTZ,
"entitlement_source_code" VARCHAR NOT NULL,
"tenant_id" VARCHAR NOT NULL,
CONSTRAINT "entitlement_entitlement_source_code_fk" FOREIGN KEY ("entitlement_source_code") REFERENCES "entitlement_source" ("code"),
CONSTRAINT "entitlement_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id")
);CREATE TABLE IF NOT EXISTS "entitlement" (
"entitlement_id" TEXT NOT NULL PRIMARY KEY,
"feature_key" TEXT NOT NULL,
"limit_value" INTEGER,
"valid_from" TIMESTAMPTZ NOT NULL,
"valid_to" TIMESTAMPTZ,
"entitlement_source_code" TEXT NOT NULL,
"tenant_id" TEXT NOT NULL,
CONSTRAINT "entitlement_entitlement_source_code_fk" FOREIGN KEY ("entitlement_source_code") REFERENCES "entitlement_source" ("code"),
CONSTRAINT "entitlement_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id")
);CREATE TABLE IF NOT EXISTS "entitlement" (
"entitlement_id" TEXT NOT NULL PRIMARY KEY,
"feature_key" TEXT NOT NULL,
"limit_value" INTEGER,
"valid_from" TEXT NOT NULL,
"valid_to" TEXT,
"entitlement_source_code" TEXT NOT NULL,
"tenant_id" TEXT NOT NULL,
CONSTRAINT "entitlement_entitlement_source_code_fk" FOREIGN KEY ("entitlement_source_code") REFERENCES "entitlement_source" ("code"),
CONSTRAINT "entitlement_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id")
);Read and written from TypeScript with the types the model gives: import { entitlement } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-access.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { entitlement } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(entitlement).select((s) => ({ entitlementId: s.entitlement.entitlementId, featureKey: s.entitlement.featureKey })).run(runner);