Implement scoping on be (#144)

This commit is contained in:
Charles Bochet
2023-05-26 14:00:32 +02:00
committed by GitHub
parent f79a45e7e6
commit 26d3716ae7
981 changed files with 14545 additions and 24213 deletions

View File

@ -1,6 +1,11 @@
import { INestApplication, Injectable, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
if (!global.prisma) {
global.prisma = new PrismaClient();
}
export default global.prisma;
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
async onModuleInit() {