Contents
pg-rebac
The pg_rebac SQL, bundled for your migrations. No database driver dependency.
npm i pg-rebac
import pg from "pg";
import { migrate } from "pg-rebac";
const client = new pg.Client(process.env.DATABASE_URL);
await client.connect();
await migrate((text) => client.query(text)); // postgres.js: (text) => sql.unsafe(text)
sql is the same text as a string; pg-rebac/pg_rebac.sql is the file. You still run the
rebacd daemon (ghcr.io/louvain-ai/rebacd) beside Postgres and SpiceDB.
Licence: Apache-2.0. Source: https://github.com/louvain-ai/pg_rebac.