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 in lib/db.ts, Better Auth uses @better-auth/drizzle-adapter, and all post reads/writes in app/lib/actions.ts, app/lib/mutations.ts, and app/lib/post-actions.ts now 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.