Recall & Review
beginner
What is Prisma in the context of NestJS?
Prisma is a modern database toolkit that helps NestJS apps talk to databases easily and safely. It generates code to access your database with simple commands.
Click to reveal answer
beginner
Which command initializes Prisma in a NestJS project?
You run
npx prisma init to create the Prisma setup files like schema.prisma and environment configs.Click to reveal answer
intermediate
How do you integrate Prisma Client into a NestJS service?
You create a PrismaService that extends PrismaClient and inject it into other services to use Prisma's database methods.
Click to reveal answer
intermediate
Why should PrismaService extend PrismaClient in NestJS?
Extending PrismaClient lets PrismaService use all database methods directly and manage connection lifecycle cleanly within NestJS.
Click to reveal answer
beginner
What is the purpose of the
schema.prisma file?It defines your database models and connection details. Prisma uses it to generate the client code for database access.
Click to reveal answer
Which command creates the Prisma client after defining models?
✗ Incorrect
npx prisma generate creates the Prisma client code based on your schema.
Where do you put your database connection URL for Prisma in NestJS?
✗ Incorrect
The .env file holds environment variables like the database URL for Prisma.
What does PrismaService usually extend in NestJS?
✗ Incorrect
PrismaService extends PrismaClient to access database methods.
Which NestJS feature helps inject PrismaService into other parts of the app?
✗ Incorrect
Dependency Injection allows PrismaService to be used in other services or controllers.
What file defines your database tables and relations in Prisma?
✗ Incorrect
schema.prisma defines models representing tables and relations.
Explain the steps to set up Prisma in a new NestJS project.
Think about installation, configuration, code generation, and integration.
You got /6 concepts.
Describe how PrismaService works inside a NestJS app and why it is useful.
Focus on PrismaService role and benefits in NestJS.
You got /5 concepts.