Gg
Explore posts from serversPPrisma
•Created by Gg on 8/31/2024 in #help-and-questions
Prisma Client: Injectable Setup Outside NestJS (with/without DI)?
In NestJS, the Prisma Client can be made injectable by extending
PrismaClient
and implementing lifecycle hooks like onModuleInit
to manage connections. Here's how it's typically done in NestJS:
1. How would a similar Prisma Client setup be implemented in a non-NestJS application (for example, an Express app) without using a dependency injection tool?
2. How would this setup change if you were to use a dependency injection tool (like Tsyringe or any other DI library) in your non-NestJS application?2 replies