Apply a policy group to a database client inside a transaction.
All policies are applied atomically — if any statement fails the entire group is rolled back and the error is re-thrown.
Policy group to apply
A pg Client or PoolClient
Client
PoolClient
SQL generation options (default: { includeIndexes: true })
{ includeIndexes: true }
const client = await pool.connect();try { await applyPolicyGroup(crud('documents'), client);} finally { client.release();} Copy
const client = await pool.connect();try { await applyPolicyGroup(crud('documents'), client);} finally { client.release();}
Apply a policy group to a database client inside a transaction.
All policies are applied atomically — if any statement fails the entire group is rolled back and the error is re-thrown.