Dante
10/25/2021, 7:06 AMRyan
10/25/2021, 7:12 AMDante
10/25/2021, 7:15 AMonMoudleInit()@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
  async onModuleInit() {
    await this.$connect();
  }
  async enableShutdownHooks(app: INestApplication) {
    this.$on('beforeExit', async () => {
      await app.close();
    });
  }
}Dante
10/25/2021, 7:34 AMconst result = await prismaService.$queryRaw`SELECT 1`;
      expect(result).toEqual([{ '?column?': 1 }]);