Technology
Prisma
Prisma is an open-source ORM for Node.js and TypeScript: you describe the data model in one schema, and it generates a typed client and the migrations. I use it with PostgreSQL in my products and on this site
- Type
- Technology
- Official site
- prisma.io
- In my work
- Projects 1 · Tools 1
- Published
Where I use it
QRuma: party games on one big screen with phones as gamepads
QRuma runs party games on one big screen. Players scan a QR code and their phones become gamepads, with nothing to install. It grew out of VibeCatter
ToolsQuiz Pack Builder: your own questions for Quiz Battle
Write your own question packs for Quiz Battle and play them on a big screen while players answer from their phones. Use cases, steps and limits
What is Prisma and how do I use it with PostgreSQL?
With Prisma the database schema and the TypeScript code cannot drift apart: a renamed column breaks the build, not the production server
Key facts
How I use Prisma
- One schema for the whole product. Users, matches, content and payments of my multiplayer platform and of this site are described in one Prisma schema on PostgreSQL; the typed client follows every change. Read the case study.
- Migrations I can read. Each change is a SQL migration in the repository. Before a release I apply it to a throwaway local database and compare the result with the schema.
- Releases with a way back. I prefer migrations that only add tables and columns, so the previous release still works if a new one has to be rolled back. Production applies them after an encrypted backup.
When I choose Prisma and its limits
Prisma fits products where most queries are ordinary reads and writes and the team wants types everywhere. It removes a whole class of mistakes and makes migrations part of the code review.
For heavy reports and unusual queries I write SQL directly; Prisma allows that in the same project. A destructive change, such as dropping a table, still needs a plan and a backup: no tool makes it safe on its own.
Used together with
Sources
- Prisma Documentation — Prisma ·
