basalt / prisma/src / CrossTenantScanSqlOptions
Interface: CrossTenantScanSqlOptions
Defined in: prisma/src/cross-tenant.ts:103
Properties
columns
> columns: (string | CrossTenantScanColumn)[]
Defined in: prisma/src/cross-tenant.ts:118
Identifier columns to return — identifiers only, never tenant data. The first one is the row identifier: it is returned as id, it orders the scan and it carries the paging cursor, so it must be unique within a tenant (the primary key). Any further column keeps its own name.
maxRows?
> optional maxRows?: number
Defined in: prisma/src/cross-tenant.ts:141
Hard cap on the rows one call may return. Default: 1000.
name
> name: string
Defined in: prisma/src/cross-tenant.ts:105
Name of the generated function (unqualified).
owner?
> optional owner?: string
Defined in: prisma/src/cross-tenant.ts:139
Role the function is owned by, i.e. the role it RUNS as. It must not be subject to the table's RLS policies (a BYPASSRLS role, or a superuser), otherwise the scan returns nothing: rlsPolicySql sets FORCE ROW LEVEL SECURITY, so even the table owner is filtered. Omitted: the function is owned by whoever runs the migration.
role
> role: string | string[]
Defined in: prisma/src/cross-tenant.ts:131
Role(s) granted EXECUTE — the application role the reconciler connects as.
schema?
> optional schema?: string
Defined in: prisma/src/cross-tenant.ts:129
Schema of the table and of the function. Default: 'public'.
table
> table: string
Defined in: prisma/src/cross-tenant.ts:107
Table to scan (unqualified).
tenantColumn?
> optional tenantColumn?: string
Defined in: prisma/src/cross-tenant.ts:109
Column holding the tenant id. Returned as tenant_id. Default: 'tenant_id'.
tenantType?
> optional tenantType?: string
Defined in: prisma/src/cross-tenant.ts:111
SQL type of the tenant column. Default: 'text'.
where?
> optional where?: string
Defined in: prisma/src/cross-tenant.ts:127
The "stuck" predicate, e.g. t."status" = 'PROCESSING' AND t."updatedAt" < now() - interval '15 minutes'. The table is aliased t.
Security
Inlined verbatim into the function body: it is migration SQL you write, never a value built from user input. Statement terminators, comments and dollar signs are refused.