Node.js / NestJS

Prisma ORM

Prisma schema, migrations, Prisma Client, relations, transactions, raw queries

25 면접 질문·
Mid-Level
1

What is Prisma?

답변

Prisma is a next-generation ORM (Object-Relational Mapping) for Node.js and TypeScript that simplifies database access. It generates a type-safe client from the Prisma schema, providing autocompletion and compile-time type checking. Unlike traditional ORMs like TypeORM or Sequelize, Prisma uses a declarative schema file and generates migrations automatically.

2

Where to define data models in a Prisma project?

답변

Prisma data models are defined in the schema.prisma file, which is the central configuration file. This file uses the Prisma Schema Language (PSL) to describe the database structure. The Prisma schema also contains the generator configuration (Prisma Client) and datasource configuration (database connection).

3

Which command generates the Prisma Client after schema modification?

답변

The prisma generate command regenerates the Prisma Client based on the current schema. This operation creates or updates the type-safe client in node_modules/@prisma/client. This command must be rerun after each schema.prisma modification for changes to be reflected in TypeScript code. This command runs automatically after npm install.

4

How to define a required field in a Prisma model?

5

What is the difference between prisma migrate dev and prisma db push?

+22 면접 질문

다음 면접을 위해 Node.js / NestJS을 마스터하세요

모든 질문, flashcards, 기술 테스트, 코드 리뷰 연습, 면접 시뮬레이터에 접근하세요.

무료로 시작하기