Skip to content

postgrelize / CreatePolicyOptions

Type Alias: CreatePolicyOptions ​

CreatePolicyOptions = Readonly<{ command?: "all" | "select" | "insert" | "update" | "delete"; kind?: "permissive" | "restrictive"; roles?: readonly string[]; using?: PolicyCondition; withCheck?: PolicyCondition; }>

Defined in: src/ddl/policy-ddl.ts:76

postgrelize extension

Options of createPolicy. PostgreSQL extension.

Example ​

ts
const options: CreatePolicyOptions = {
  command: 'select',
  roles: ['app_user'],
  using: "tenant_id = current_setting('app.tenant_id')::int",
};
await queryInterface.createPolicy('documents', 'tenant_isolation', options);

Released under the MIT License.