NestJS setup

If you followed the NestJS docs to implement Prisma, you already created a prisma.service.ts. Open it and add the following code-
import { setInstrumentedPrismaClient } from "@metis-data/prisma-interceptor";
import { Injectable, OnModuleInit } from "@nestjs/common";
import { PrismaClient } from "@prisma/client";
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
constructor() {
super({
log: [{
emit: 'event',
level: 'query',
}]
});
}
async onModuleInit() {
await this.$connect();
setInstrumentedPrismaClient(this)
}
}