Files
MinglarBackendNestJS/src/common/database/prisma.service.ts

14 lines
350 B
TypeScript
Raw Normal View History

import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
2025-11-10 15:05:01 +05:30
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
async onModuleInit() {
await this.$connect();
}
async onModuleDestroy() {
await this.$disconnect();
}
}