db/cell_view_sql.ts view source
(roles: string, scope_ids: string): string import {caller_role_grants_cte} from '@fuzdev/fuz_app/db/cell_view_sql.js'; The caller_role_grants CTE body (no WITH): the caller's
(role, scope_id) pairs, unnested once per query from the parallel arrays
at placeholders roles and scope_ids. PG 12+ inlines a non-recursive
single-use CTE, so this is planner-equivalent to a subquery — the form is
for clarity.
roles
the placeholder of the roles array (text[])
stringscope_ids
the placeholder of the scope-id array (uuid[])
stringreturns
string the CTE body