Files
Chromacase/back/src/prisma/prisma.service.ts
Bluub 38ddea057d feat: add song crd and tests (#80)
Co-authored-by: Zoe Roux <zoe.roux@sdg.moe>
2022-09-26 23:21:55 +09:00

16 lines
390 B
TypeScript

import { INestApplication, Injectable, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
async onModuleInit() {
await this.$connect();
}
async enableShutdownHooks(app: INestApplication) {
this.$on('beforeExit', async () => {
await app.close();
});
}
}