0
0
NestJSframework~5 mins

Prisma setup in NestJS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Anpx prisma generate
Bnpm run start
Cnpx prisma migrate
Dnpm install prisma
Where do you put your database connection URL for Prisma in NestJS?
A.env file
Bmain.ts
Cpackage.json
Dprisma.service.ts
What does PrismaService usually extend in NestJS?
AController
BHttpService
CModule
DPrismaClient
Which NestJS feature helps inject PrismaService into other parts of the app?
AMiddleware
BDependency Injection
CGuards
DInterceptors
What file defines your database tables and relations in Prisma?
Amain.ts
Bapp.module.ts
Cschema.prisma
Dpackage.json
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.