Prometheus Entity Management API
    Preparing search index...

    Interface TenantScopedTableConfig<T>

    interface TenantScopedTableConfig<T extends object = Record<string, unknown>> {
        normalize?: (row: T) => Record<string, unknown>;
        primaryKey?: string[];
        shapeStreamFactory: (
            params: { table: string; tenantClaim: TenantClaim; where: string },
        ) => ShapeStream<T>;
        table: string;
        tenantColumn: string | null;
        type: string;
    }

    Type Parameters

    • T extends object = Record<string, unknown>
    Index
    normalize?: (row: T) => Record<string, unknown>
    primaryKey?: string[]
    shapeStreamFactory: (
        params: { table: string; tenantClaim: TenantClaim; where: string },
    ) => ShapeStream<T>

    Factory invoked with the constructed where clause and the tenant claim. Consumers wire their preferred Electric ShapeStream builder here. The factory must use the supplied where verbatim (no widening).

    table: string
    tenantColumn: string | null

    Column used for tenant filtering.

    • A string ("company_id") yields WHERE company_id = '<companyId>'.
    • Explicit null means the table IS the tenant root and is filtered by id = '<companyId>'. Only the company table qualifies.
    • undefined is rejected — this is the safety gate.
    type: string