holistics / holistics/dbml

Add support for Postgres RLS policies

Open
#824 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
3.7k
Forks
233
Avg merge
1d 23h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.