How to change the database provider to Supabase.
ShipThing
uses Neon as the database provider with Prisma as the ORM as well as Clerk for authentication. This guide will provide the steps you need to switch the database provider from Neon to Supabase. This guide is based on a few existing resources, including Supabase’s guide and Prisma’s guide.
ShipThing
project.
Transaction
mode, with the port ending in 6543
. We’ll call this DATABASE_URL
.Session
mode, with the port ending in 5432
. We’ll call this DIRECT_URL
..env
file with the Supabase connection details. Make sure you add ?pgbouncer=true&connection_limit=1
to the end of the DATABASE_URL
value.
pgbouncer=true
disables Prisma from generating prepared statements. This is required since our connection pooler does not support prepared statements in transaction mode yet. The connection_limit=1
parameter is only required if you are using Prisma from a serverless environment.database
package. We’ll remove the Neon extensions and connect to Supabase directly, which should automatically use the environment variables we set earlier.
prisma/schema.prisma
file so it contains the DIRECT_URL
. This allows us to use the Prisma CLI to perform other actions on our database (e.g. migrations) by bypassing Supavisor.
ShipThing
project: