Drizzle <> Supabase
This guide assumes familiarity with:
- Database connection basics with Drizzle
- Drizzle PostgreSQL drivers - docs
According to the official website, Supabase is an open source Firebase alternative for building secure and performant Postgres backends with minimal configuration.
Checkout official Supabase + Drizzle docs.
Step 1 - Install packages
npm
yarn
pnpm
bun
Step 2 - Initialize the driver and make a query
If you need to provide your existing driver:
If you decide to use connection pooling via Supabase (described here), and have “Transaction” pool mode enabled, then ensure to turn off prepare, as prepared statements are not supported.
Connect to your database using the Connection Pooler for serverless environments, and the Direct Connection for long-running servers.