Skip to content

Add support for RLS #824

@scribahti

Description

@scribahti

Enhancement.

It would be great to model RLS policies for Postgres with dbml and generate CREATE POLICY scripts with dbml2sql.

Suggested markup:

Policy {
  name 'Users can take all actions on their own accounts'
  schema public
  table users
  behavior permissive
  command all
  roles [authenticated]
  using `auth.uid() = user_id`
  check null
}

schema defaults to public if not provided.

behavior can have the values permissive or restrictive. It defaults to permissive if not provided.

command can have the values select, insert, update, delete, or all.

roles accepts a list of roles and defaults to public if none are provided.

using and check default to null if not provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions