As mentioned in the title, I am trying to do dependency injection operations with a node.js project, but I don't know how to use the inversify module with prisma.
I did a lot of research on the internet, but I could not find a clear answer about this, but I also provided research with artificial intelligence, I think there is no clear standard.
Hy, U can do this, at in ur src/services/
create prisma.ts
and put it:
import { injectable } from "inversify"
import { PrismaClient } from "@prisma/client"
@injectable()
export class PrismaService {
private readonly _prisma: PrismaClient
constructor() {
this._prisma = new PrismaClient()
}
get client(): PrismaClient {
return this._prisma
}
}