0
Challenge · 77Production & the Interview Gauntlet
ORMs with Supabase: Prisma & Drizzle
Opsused in ~70% of apps
Prisma and Drizzle both advertise themselves as "just point me at a Postgres URL." That sentence is true and it is the reason so many Supabase + Prisma projects work fine in local dev, pass code review, and then fail in production with an error that mentions neither Prisma nor your schema — because the ORM's assumptions about a stable connection collide with exactly the pooling behaviour concept 76 just taught you.
Core idea. An ORM needs two different kinds of connection to a pooled Supabase database, not one: a pooled, prepared-statement-free connection for runtime queries, and a direct or session connection for migrations, which run DDL and hold locks the transaction pooler cannot pin. Prisma calls these url and directUrl; Drizzle expresses the same split as two separate client instances. Skipping the split isn't a style choice — it is the single most common cause of "works locally, breaks in production" for a Supabase + ORM app.
poke it, drag it,
try to break it
try to break it
no slides here.
you drive.
you drive.
Playground, this isn't a screenshot
runtimeuses DATABASE_URL :6543 (pooled)
// schema.prisma
datasource db {
provider = "postgresql"
url = env("DATABASE_URL") // pooler :6543
}
// anywhere in the app
await prisma.post.findMany({ where: { isPublic: true } })↑ play a little first, then dig in