pgvpd — transparent multi-tenancy for Drizzle via Postgres RLS #5411
solidcitizen
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
pgvpd is a lightweight Postgres protocol-level proxy that injects tenant identity at connection time. Row-level security handles the rest — no middleware, no query rewriting, no
.where(eq(tenantId, ctx.tenant))on every query.It works transparently with Drizzle. Here's what tenant-scoped queries look like:
We have a full Drizzle integration test suite covering SELECT isolation, cross-tenant blocking, INSERT scoping, RLS WITH CHECK enforcement, transactions, and superuser bypass — in both passthrough and connection-pool modes.
Repo: https://github.com/solidcitizen/pgvpd
Beta Was this translation helpful? Give feedback.
All reactions