Prisma

A next-generation ORM for TypeScript/Node. You declare your data model in a single schema.prisma file; Prisma generates a fully type-safe client and manages migrations from it. The headline is developer experience: autocomplete on every query, compile-time errors when you reference a column that doesn’t exist, and a readable schema that doubles as documentation.

Description

  • Declarative schema β€” models, relations, indexes, enums in schema.prisma as the single source of truth.
  • Type-safe client β€” generated client gives end-to-end types from DB to application code.
  • Migrations β€” prisma migrate diffs the schema and generates/apply versioned SQL migrations.
  • Prisma Studio β€” a GUI to browse/edit data.
  • Relation queries β€” ergonomic nested reads/writes without hand-written joins.
  • Multi-DB β€” PostgreSQL, MySQL, SQLite, SQL Server, MongoDB.

Download or use

npm i prisma -D && npm i @prisma/client
npx prisma init && npx prisma migrate dev

Reasoning for

Prisma is the ORM in the Tech To The Rescue platform, over PostgreSQL 17 with pgvector. It fits a TypeScript-first Next.js codebase where a readable, version-controlled schema matters β€” especially given that one of the diagnosis findings was schema debt carried over from no-code migrations (150–200 legacy columns, duplicate status fields). A declarative schema.prisma plus migrations makes that debt visible and gives a disciplined path to pay it down, and the typed client removes a whole class of runtime query bugs. Where the schema is volatile (fast-changing forms), the team leans on JSON metadata columns β€” which Prisma models cleanly β€” rather than migrating weekly.

Alternatives considered

  • Drizzle ORM β€” the lighter, SQL-closer TypeScript ORM I used on AGRE; Drizzle is thinner and more SQL-explicit, Prisma is more batteries-included with a richer migration/Studio story.
  • TypeORM / Sequelize β€” older Node ORMs; less type-safety and rougher DX than Prisma.
  • Kysely β€” type-safe query builder (not a full ORM); more control, less abstraction.
  • Raw SQL β€” maximum control; loses the generated types and migration ergonomics.

Resources


Template: tool