resourceAttributeIdidentifierrequiredWhat identifies the value, made by the application
Becomes the column resource_attribute_id of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:74
A value of an attribute for a resource
Model identityAbac. Written in commons/data/models/identity-abac/mod.ts:71. Identified by resourceAttributeId.
resourceAttributeIdidentifierrequiredWhat identifies the value, made by the application
Becomes the column resource_attribute_id of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:74
resourceIdtextrequiredThe resource
Becomes the column resource_id of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:76
resourceTypetextrequiredThe kind of resource
Becomes the column resource_type of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:75
updatedAtinstantrequiredWhen it was last asserted
Becomes the column updated_at of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:78
valuestructuredrequiredThe value, of the type the definition says
Becomes the column value of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:77
valueKeytextrequiredA hash of the tenant, the resource and the attribute, unique, so that a resource has one value of an attribute
Becomes the column value_key of resource_attribute.
Written at commons/data/models/identity-abac/mod.ts:79
definitiononeThe attribute To attributeDefinition. Written at commons/data/models/identity-abac/mod.ts:72
tenantoneThe tenant the resource is in To tenant. Written at commons/data/models/identity-abac/mod.ts:109
Projects to the table resource_attribute with the primary key resource_attribute_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
definition_attribute_definition_id | text | false | reference | resourceAttribute.definition |
resource_attribute_id | text | false | attribute | resourceAttribute.resourceAttributeId |
resource_id | text | false | attribute | resourceAttribute.resourceId |
resource_type | text | false | attribute | resourceAttribute.resourceType |
tenant_id | text | false | reference | resourceAttribute.tenant |
updated_at | timestamp | false | attribute | resourceAttribute.updatedAt |
value | json | false | attribute | resourceAttribute.value |
value_key | text | false | attribute | resourceAttribute.valueKey |
CREATE TABLE IF NOT EXISTS "resource_attribute" (
"resource_attribute_id" VARCHAR NOT NULL PRIMARY KEY,
"resource_type" VARCHAR NOT NULL,
"resource_id" VARCHAR NOT NULL,
"value" JSON NOT NULL,
"updated_at" TIMESTAMPTZ NOT NULL,
"value_key" VARCHAR NOT NULL,
"tenant_id" VARCHAR NOT NULL,
"definition_attribute_definition_id" VARCHAR NOT NULL,
CONSTRAINT "resource_attribute_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "resource_attribute_definition_attribute_definition_id_fk" FOREIGN KEY ("definition_attribute_definition_id") REFERENCES "attribute_definition" ("attribute_definition_id"),
CONSTRAINT "resource_attribute_value_key_uq" UNIQUE ("value_key")
);CREATE TABLE IF NOT EXISTS "resource_attribute" (
"resource_attribute_id" TEXT NOT NULL PRIMARY KEY,
"resource_type" TEXT NOT NULL,
"resource_id" TEXT NOT NULL,
"value" JSONB NOT NULL,
"updated_at" TIMESTAMPTZ NOT NULL,
"value_key" TEXT NOT NULL,
"tenant_id" TEXT NOT NULL,
"definition_attribute_definition_id" TEXT NOT NULL,
CONSTRAINT "resource_attribute_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "resource_attribute_definition_attribute_definition_id_fk" FOREIGN KEY ("definition_attribute_definition_id") REFERENCES "attribute_definition" ("attribute_definition_id"),
CONSTRAINT "resource_attribute_value_key_uq" UNIQUE ("value_key")
);CREATE TABLE IF NOT EXISTS "resource_attribute" (
"resource_attribute_id" TEXT NOT NULL PRIMARY KEY,
"resource_type" TEXT NOT NULL,
"resource_id" TEXT NOT NULL,
"value" TEXT NOT NULL,
"updated_at" TEXT NOT NULL,
"value_key" TEXT NOT NULL,
"tenant_id" TEXT NOT NULL,
"definition_attribute_definition_id" TEXT NOT NULL,
CONSTRAINT "resource_attribute_tenant_id_fk" FOREIGN KEY ("tenant_id") REFERENCES "tenant" ("tenant_id"),
CONSTRAINT "resource_attribute_definition_attribute_definition_id_fk" FOREIGN KEY ("definition_attribute_definition_id") REFERENCES "attribute_definition" ("attribute_definition_id"),
CONSTRAINT "resource_attribute_value_key_uq" UNIQUE ("value_key")
);Read and written from TypeScript with the types the model gives: import { resourceAttribute } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-abac.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { resourceAttribute } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(resourceAttribute).select((s) => ({ resourceAttributeId: s.resourceAttribute.resourceAttributeId, resourceType: s.resourceAttribute.resourceType })).run(runner);