M. Kodirov

STAGE 04 / LESSON 05

Prisma as a database client

An ORM can provide typed application APIs for common database operations.

THE IDEA

Understand it.

Prisma uses a schema to describe models and generates a client for querying them. Migrations manage changes to the database schema, while the client handles application queries.

An ORM does not remove the need to understand SQL, indexes, transactions or access control. Review generated queries and migration effects, especially for large or production tables.

SEE IT IN CONTEXT

Find tasks with Prisma

const tasks = await prisma.task.findMany({
  where: { status: "open" },
  orderBy: { id: "desc" },
  take: 20,
});

This query assumes a generated Prisma client and a Task model with matching fields. It reads up to 20 open tasks.

LEARN FROM REAL WEBSITES

See it in the real world.

These simplified structures come from public sources. Company systems change, and the sources may describe only one project or an earlier design.

Elsevier

Prisma customer story, 2021

A publishing workflow pilot

Prisma's 2021 customer story describes an Elsevier peer-review pilot using Prisma Client and Prisma Migrate.

  1. Peer-review application
  2. Prisma Client
  3. Application data

What to learn: A typed database client can help a small team evolve a data-backed application. This is a vendor-reported pilot, not Elsevier's entire site.

Read the source: Elsevier customer story

Cal.com

Public code checked November 2026

Prisma in an API module

Cal.com publishes a Prisma module in its API project, with separate read and write services.

  1. API Prisma module
  2. Read and write services
  3. Database configuration

What to learn: The module illustrates how an API can organize database access. The public source describes this project, not every Cal.com service.

Read the source: Cal.com Prisma module

TRY IT YOURSELF

Practice.

Does a typed Prisma query automatically decide whether the current user may see each task?

Show one possible answer

No. The application must enforce authorization, for example by including an allowed owner or tenant scope in its query.

GO DEEPER

Official references.