Skip to content

Instantly share code, notes, and snippets.

View jon-whit's full-sized avatar

Jonathan Whitaker jon-whit

View GitHub Profile
fga index create \
--name group_member_user_index \
--user-type=user \
--relation=member \
--object-type=group \
--out views.sql
Output:
--- views.sql
@jon-whit
jon-whit / docker-compose.yml
Last active April 9, 2024 23:36
FGA Exclusion Query to Materialize MUTUALLY RECURSIVE
version: "3"
services:
postgres:
image: postgres
ports:
- 5432:5432
restart: always
environment:
POSTGRES_PASSWORD: password
command:
@jon-whit
jon-whit / example1-tuples.sql
Last active April 10, 2024 17:51
FGA Indexes and Cyclical Behavior
INSERT INTO tuples VALUES ('document', '1', 'viewer', 'editor', 'document', '1');

Setup

  1. Start a Postgres instance, for example
docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -d docker
  1. Open a psql client shell
psql -h localhost -p 5432  -U postgres -d postgres
Password for user postgres: <enter password>