ghostfolio/apps/api/src/services/prisma.service.ts

16 lines
354 B
TypeScript
Raw Normal View History

2021-04-13 21:53:58 +02:00
import { Injectable, OnModuleDestroy, OnModuleInit } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService
extends PrismaClient
2021-04-13 21:53:58 +02:00
implements OnModuleInit, OnModuleDestroy {
async onModuleInit() {
await this.$connect();
}
async onModuleDestroy() {
await this.$disconnect();
}
}