Rowguard - RLS Policy DSL - v0.2.0
    Preparing search index...

    Function applyPolicyGroup

    • 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.

      Parameters

      • group: PolicyGroup

        Policy group to apply

      • client: { query(sql: string): Promise<unknown> }

        A pg Client or PoolClient

      • options: SQLGenerationOptions = ...

        SQL generation options (default: { includeIndexes: true })

      Returns Promise<void>

      const client = await pool.connect();
      try {
      await applyPolicyGroup(crud('documents'), client);
      } finally {
      client.release();
      }