Database workflow · documentation checklist

Drizzle with Supabase:
check the connection first.

Choose a connection, then check who can read and change a row. Includes a connection selector and a downloadable, executed local access-control example.

Edited by Clinton Feyisitan · Review scope: connection documentation reviewed 14 October; local Drizzle/PGlite access checks executed 28 October 2026. Synthetic data, one local connection. No hosted Supabase, authentication, pooling or performance test. Sources and run scope.

Published 14 October 2026

Start with the runtime, not a copied connection string

Drizzle’s Supabase guide confirms that the ORM can connect to a Supabase Postgres database. The connection mode depends on where the code runs. A string copied from a tutorial may point at the wrong endpoint or assume network support your host does not have.

Use the selector below to locate the relevant documentation. It does not inspect your project or validate credentials.

Executed local example · 28 October 2026

A successful query does not prove safe access

Using the same Drizzle query, our synthetic two-tenant database first returned both tenants’ rows. Enabling row-level security with a tenant policy restricted those reads. But running as the table owner still exposed all rows until forced RLS was enabled. A privileged BYPASSRLS role continued to bypass the policy.

14 of 14 expected outcomes observed. This is a small reproducible example, not a security certification or a score for either product. Denied writes and zero-row updates are successful checks here because denial was the expected result.

CaseObserved resultCheck
1. Grants, RLS offBoth rows visibleExpected outcome observed
2. RLS on, no policyNo rows visibleExpected outcome observed
3. Tenant A readOnly A’s rowExpected outcome observed
4. Tenant B readOnly B’s rowExpected outcome observed
5. Own insertNew A row returnedExpected outcome observed
6. Cross-tenant insertDenied: 42501Expected outcome observed
7. Cross-tenant updateZero rows updatedExpected outcome observed
8. Reassign row tenantDenied: 42501Expected outcome observed
9. Cross-tenant deleteZero rows deletedExpected outcome observed
10. Table ownerAll three rows visibleExpected outcome observed
11. Owner with FORCE RLSNo rows visibleExpected outcome observed
12. BYPASSRLS roleAll three rows visibleExpected outcome observed
13. Aborted transactionInserted row rolled backExpected outcome observed
14. Other tenant intactB’s original body unchangedExpected outcome observed

Download the runnable local example

The ZIP contains the source, exact dependency lockfile, README and actual results. Tested with Node v25.6.1, Drizzle ORM 0.45.4 and PGlite 0.5.13 running PostgreSQL 18.6 in WebAssembly. Install the pinned dependencies, then run npm test. No hosted account or paid API is needed.

What this tells you before choosing a connection

An ORM constructs queries; the database role and policies determine access. Test the role your application really uses. A successful admin query does not validate an end-user policy, and a successful UPDATE can affect zero rows.

What remains untested

The fixture compares a tenant column with PostgreSQL current_user. It does not reproduce Supabase auth.uid(), JWT handling, the Data API, service keys, poolers, concurrency or a live deployment. The rollback case aborts one local transaction; it is not a migration rehearsal. Keep browser, ordinary-user and privileged server paths separate and validate each in your own authorized environment.

PostgreSQL role and RLS rules · Drizzle’s PGlite driver · PGlite local runtime · Supabase’s separate authentication and RLS guidance

Edited by Clinton Feyisitan · Review scope: Local fixture executed; four official documentation pages read 28 October 2026. Source receipts and limits.

Local planning helper

Find the documented connection route

Choose an environment to see its documented route and checks.

Read Supabase’s current connection table →

Keep the server and browser paths separate

For browser access, Supabase’s Data API and client libraries use the project URL and an appropriate API key rather than a database password. Row Level Security policies govern that access. Never place a privileged connection string or administrative secret in browser code.

For server-side Drizzle, take the endpoint from the project’s Connect panel. Confirm its port, username, network support and pool mode. Keep credentials in approved server-side secret storage.

Review the documented RLS boundaries →

Check pooling and migrations separately

Supabase documents transaction pooling for short-lived functions and a direct route for migration, backup and restore tools. Drizzle’s Postgres.js transaction-pooling example uses prepare: false. Session features and prepared statements cannot simply be assumed to carry over between modes.

A connection that works for one query does not prove a migration, rollback or access policy works. Keep those as separate checks.

A checklist before live data

  1. Record driver version, runtime and the selected connection mode.
  2. Check network support from the actual host.
  3. Use synthetic rows to test the intended read/write path.
  4. Test allowed and denied access through the real application path.
  5. Inspect a schema change on a disposable database, then rehearse rollback.
  6. Record the result and unresolved limits before enabling live traffic.

These steps are proposed. The selector was tested locally; no live Supabase database, provider account or migration was executed for this article.