Bird
0
0

Why does Prisma Client require a schema file and how does it affect usage in NestJS?

hard📝 Conceptual Q10 of 15
NestJS - Database with Prisma
Why does Prisma Client require a schema file and how does it affect usage in NestJS?
ASchema is optional and only used for migrations
BSchema defines the database models and enables type-safe queries
CSchema is used to configure HTTP routes in NestJS
DSchema automatically generates frontend UI components
Step-by-Step Solution
Solution:
  1. Step 1: Understand Prisma schema role

    Schema defines models, fields, and relations for the database.
  2. Step 2: Connect schema to Prisma Client usage

    Prisma Client uses schema to generate type-safe queries and typings.
  3. Final Answer:

    Schema defines the database models and enables type-safe queries -> Option B
  4. Quick Check:

    Schema drives type safety and model definitions [OK]
Quick Trick: Prisma schema is the blueprint for your database and types [OK]
Common Mistakes:
  • Thinking schema is optional for Prisma Client
  • Confusing schema with HTTP routing config
  • Assuming schema generates frontend code

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes