Prisma + PlanetScale → Drizzle ORM + Neon
mediumPlanetScale killed its free tier, prompting many to move to Neon (serverless Postgres). Drizzle is lighter than Prisma and Neon-native with HTTP driver support for edge environments.
Create project at neon.tech. Get connection string. Neon supports branching for dev/staging — create a dev branch.
npm install drizzle-orm @neondatabase/serverless && npm install -D drizzle-kit
Translate Prisma schema to Drizzle table definitions.
import { pgTable, serial, text, timestamp } from 'drizzle-orm/pg-core'
export const users = pgTable('users', { id: serial('id').primaryKey(), email: text('email').notNull().unique() })// drizzle.config.ts
export default { schema: './src/db/schema.ts', out: './drizzle', dialect: 'postgresql', dbCredentials: { url: process.env.DATABASE_URL! } }npx drizzle-kit generate && npx drizzle-kit migrate
prisma.user.findMany() → db.select().from(users). prisma.user.create() → db.insert(users).values({}).
import { neon } from '@neondatabase/serverless'
import { drizzle } from 'drizzle-orm/neon-http'
const sql = neon(process.env.DATABASE_URL!)
export const db = drizzle(sql)mysqldump from PlanetScale, pgloader to convert MySQL → PostgreSQL, then load into Neon.
What this migration involves
Moving from Prisma + PlanetScale to Drizzle ORM + Neon is rated medium and takes about 6-12h on a typical project. The guide breaks it into 6 steps, 5 of which ship with runnable commands and 1 with a verification check.
Related migrations
FAQ
How long does migrating from Prisma + PlanetScale to Drizzle ORM + Neon take?
Around 6-12h for a typical project — 6 steps, difficulty rated medium, 5 of them with copy-paste commands.
Is moving from Prisma + PlanetScale to Drizzle ORM + Neon reversible?
No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your Prisma + PlanetScale data before you start.
What does Drizzle ORM + Neon cost compared to Prisma + PlanetScale?
Pricing for both tools is contact-based or not tracked yet.