Files
hoppscotch/packages/hoppscotch-backend/src/prisma/prisma.service.ts
Balu Babu 4ce9e67460 chore: added global lint and test commands to backend package (#81)
* chore: added global lint and test commands to backend package

* chore: removed lint command from root scope execution
2023-04-10 12:25:45 +05:30

20 lines
389 B
TypeScript

import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
@Injectable()
export class PrismaService
extends PrismaClient
implements OnModuleInit, OnModuleDestroy
{
constructor() {
super();
}
async onModuleInit() {
await this.$connect();
}
async onModuleDestroy() {
await this.$disconnect();
}
}