Skip to content

Neon.Role reference

Source: src/Neon/Role.ts

A Postgres role on a Neon branch. Neon makes every role it creates a member of neon_superuser: it can read and write all data, create databases and roles, and bypass row-level security. Use roles for separate logins and passwords, not to restrict access.

A login role on a branch

const app = yield* Neon.Role("App", { branch });
// app.roleName and app.password (Redacted) connect to branch.origin.host

A role on the project’s default branch

const migrator = yield* Neon.Role("Migrator", { project, name: "migrator" });
const owner = yield* Neon.Role("Owner", { branch, name: "app_owner", noLogin: true });