Prisma is the most popular TypeScript ORM. Its vocabulary — schema, migrations, upsert, eager loading — appears constantly in backend architecture discussions and code reviews.
0 / 5 completed
1 / 5
A developer says: 'Define the schema in schema.prisma and run a migration.' What is a Prisma schema?
The Prisma schema (schema.prisma) is a declarative file where you define your database models using Prisma Schema Language. It defines tables (models), fields, types, relations, and the database connection. Prisma uses it to generate SQL migrations and the type-safe Prisma Client. In discussions: 'update the schema' means modify schema.prisma then run prisma migrate dev.
2 / 5
A PR review says: 'Use upsert instead of separate find + create.' What does upsert mean?
Upsert (update + insert) is an atomic database operation: if a matching record exists, update it; if not, create it. In Prisma: prisma.user.upsert({ where: { email }, update: { name }, create: { email, name } }). It avoids the race condition of a separate 'check then create.' In code reviews: 'use upsert' means combine the lookup and create/update into a single efficient operation.
3 / 5
A developer says: 'The include option in Prisma is for eager loading related models.' What does eager loading mean?
Eager loading means fetching related records together with the main query, not in a separate query. In Prisma, include: { posts: true } on a user query also fetches their posts in the same round-trip. The alternative is lazy loading — making a separate query when you access the relation. Eager loading avoids the N+1 problem. In performance discussions: 'use include to eager-load' means reduce round-trips to the database.
4 / 5
A developer mentions a Prisma migration. What does a migration do?
A migration is a versioned SQL file that describes how to change the database schema from one state to another. When you modify schema.prisma, running prisma migrate dev creates a migration file with the SQL diff (ALTER TABLE, CREATE INDEX, etc.) and applies it. Migration files are tracked in source control. In discussions: 'run the migration' means apply pending schema changes to the database.
5 / 5
A developer says: 'Use Prisma's transaction API for this multi-step operation.' What is a database transaction?
A transaction groups multiple database operations atomically — either all commit or all roll back. If any step fails, the database reverts to its state before the transaction started. In Prisma: prisma.$transaction([op1, op2, op3]) or the interactive transaction API. In discussions: 'wrap in a transaction' means ensure related operations (e.g., deducting balance + creating payment record) can't partially succeed.