Skip to content

Commit

Permalink
feat: removes onModuleInit in PrismaService - inits lazily
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasshern committed Dec 14, 2023
1 parent 7840844 commit 6f5ad70
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions examples/bri-3/src/shared/prisma/prisma.service.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { Injectable, OnModuleInit } from '@nestjs/common';
import { Injectable } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';

@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit {
export class PrismaService extends PrismaClient {
constructor() {
super({ log: ['info'] });
}
async onModuleInit() {
await this.$connect();
}
}

0 comments on commit 6f5ad70

Please sign in to comment.