Skip to content

tenant\_db/schema

tenant_db/schema

Variables

PROTECTED_AUTH_COLLECTIONS

const PROTECTED_AUTH_COLLECTIONS: Set<string>;

Defined in: platform-utils/src/tenant_db/schema.ts:5

Collections stored in PROTECTED_AUTH_SCHEMA instead of public.


PROTECTED_AUTH_SCHEMA

const PROTECTED_AUTH_SCHEMA: "norbital_auth" = 'norbital_auth';

Defined in: platform-utils/src/tenant_db/schema.ts:2

Schema for identity/authZ collections that survive public-schema rebuilds.

Functions

collectionSchema()

function collectionSchema(_collectionName): string;

Defined in: platform-utils/src/tenant_db/schema.ts:9

Parameters

Parameter Type
_collectionName string

Returns

string


joinColumnCollectionName()

function joinColumnCollectionName(columnName): string;

Defined in: platform-utils/src/tenant_db/schema.ts:50

Infer collection name from a relationship join column (user_id, task_from_id, …).

Parameters

Parameter Type
columnName string

Returns

string


protectedSchemaBootstrapSql()

function protectedSchemaBootstrapSql(): string;

Defined in: platform-utils/src/tenant_db/schema.ts:45

Idempotent bootstrap for the protected auth schema.

Returns

string


qualifiedHistoryTableName()

function qualifiedHistoryTableName(collectionName): string;

Defined in: platform-utils/src/tenant_db/schema.ts:40

Escaped qualified temporal history table ref.

Parameters

Parameter Type
collectionName string

Returns

string


qualifiedRelationshipTable()

function qualifiedRelationshipTable(
   relationshipName, 
   from, 
   to): string;

Defined in: platform-utils/src/tenant_db/schema.ts:31

Escaped qualified relationship (junction) table ref.

Parameters

Parameter Type
relationshipName string
from string
to string

Returns

string


qualifiedTableName()

function qualifiedTableName(collectionName): string;

Defined in: platform-utils/src/tenant_db/schema.ts:26

Escaped qualified table ref for SQL: "schema"."c_<collection>".

Parameters

Parameter Type
collectionName string

Returns

string


relationshipSchema()

function relationshipSchema(from, to): string;

Defined in: platform-utils/src/tenant_db/schema.ts:13

Parameters

Parameter Type
from string
to string

Returns

string


tableName()

function tableName(collectionName): string;

Defined in: platform-utils/src/tenant_db/schema.ts:21

Unqualified table id: c_<collection>.

Parameters

Parameter Type
collectionName string

Returns

string