2026-06-01backend
Prisma replaced with Drizzle ORM for posts and auth
- Change: Prisma was removed from the runtime and dev toolchain. A shared Drizzle schema now lives in
lib/schema.ts, the database client is created inlib/db.ts, Better Auth uses@better-auth/drizzle-adapter, and all post reads/writes inapp/lib/actions.ts,app/lib/mutations.ts, andapp/lib/post-actions.tsnow use Drizzle query builders. - Why: Drizzle removes the Prisma codegen/runtime dependency and gives the app a smaller, more portable data layer that is easier to adapt for a future Cloudflare runtime.
- Affected Modules:
lib/db.ts,lib/schema.ts,drizzle.config.ts,app/lib/auth.ts,app/lib/actions.ts,app/lib/mutations.ts,app/lib/post-actions.ts,package.json,pnpm-lock.yaml,prisma/(deleted) - Trade-offs:
- Pro: One shared schema definition drives both auth and content queries; no Prisma client generation step is needed anymore.
- Con: The current database connection still uses
pg.Pool, so a full Cloudflare move will still require swapping the driver layer even though the ORM layer is now edge-friendly.