Many developers starting with Next.js and Supabase wonder if adding an ORM like Prisma or Drizzle is necessary or just an extra step.
No, you don't need an ORM. However, as your application grows, an ORM can help maintain type safety, handle migrations, and make your database interactions more readable.
Drizzle is a lightweight approach. It feels like writing JavaScript instead of a new query language.
Prisma offers an exceptional developer experience (DX) but comes with some performance trade-offs, particularly in serverless environments.
Supabase provides its own library that acts as a query builder. You can generate types directly from your database, which might make an additional ORM unnecessary for simpler projects.
When choosing between an ORM and raw SQL, consider the following: