aitasker / backend /src /database /prisma.service.ts
minhhungg's picture
feat: upload dataset and simulation files to Hugging Face
675f6bd
Raw
History Blame Contribute Delete
508 Bytes
import { Injectable, OnModuleInit, OnModuleDestroy, Logger } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
private readonly logger = new Logger(PrismaService.name);
async onModuleInit() {
await this.$connect();
this.logger.log('Database connected');
}
async onModuleDestroy() {
await this.$disconnect();
this.logger.log('Database disconnected');
}
}