IF Commons GitHub

deviceSession

concept

A session of a person that is on a device, so that a decision about the person can use the device's posture

Model identityDevice. Written in commons/data/models/identity-device/mod.ts:93. Identified by device, session.

Governance: attributes

boundAtinstantrequired

When the session was bound to the device

Becomes the column bound_at of device_session.

Written at commons/data/models/identity-device/mod.ts:93

Governance: relationships

deviceone

The device To device. Written at commons/data/models/identity-device/mod.ts:93

sessionone

The session To loginSession. Written at commons/data/models/identity-device/mod.ts:93

Logical: the table

Projects to the table device_session with the primary key device_principal_id, session_login_session_session_id.

ColumnTypeNullRoleFrom
bound_attimestampfalseattributedeviceSession.boundAt
device_principal_idtextfalsereferencedeviceSession.device
session_login_session_session_idtextfalsereferencedeviceSession.session

Physical: SQL

CREATE TABLE IF NOT EXISTS "device_session" (
    "device_principal_id" VARCHAR NOT NULL,
    "session_login_session_session_id" VARCHAR NOT NULL,
    "bound_at" TIMESTAMPTZ NOT NULL,
    PRIMARY KEY ("device_principal_id", "session_login_session_session_id"),
    CONSTRAINT "device_session_device_principal_id_fk" FOREIGN KEY ("device_principal_id") REFERENCES "device" ("principal_id"),
    CONSTRAINT "device_session_session_login_session_session_id_fk" FOREIGN KEY ("session_login_session_session_id") REFERENCES "login_session" ("session_id")
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { deviceSession } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity-device.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { deviceSession } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(deviceSession).select((s) => ({ devicePrincipalId: s.deviceSession.devicePrincipalId, sessionLoginSessionSessionId: s.deviceSession.sessionLoginSessionSessionId })).run(runner);

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