File tree Expand file tree Collapse file tree
apps/prisma-sample/src/prisma Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import {
2- INestApplication ,
3- Injectable ,
4- Logger ,
5- OnModuleInit ,
6- } from '@nestjs/common' ;
1+ import { Injectable , Logger } from '@nestjs/common' ;
72import { PrismaClient } from '@prisma/client' ;
83
94@Injectable ( )
10- export class PrismaService extends PrismaClient implements OnModuleInit {
5+ export class PrismaService extends PrismaClient {
116 logger = new Logger ( PrismaService . name ) ;
127
138 constructor ( ) {
@@ -21,19 +16,19 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
2116 } ) ;
2217 }
2318
24- async onModuleInit ( ) {
25- await this . $connect ( ) ;
19+ // async onModuleInit() {
20+ // await this.$connect();
2621
27- this . $on ( 'query' as any , async ( e : any ) => {
28- this . logger . debug ( `(${ e . duration } ms) ${ e . query } ` ) ;
29- } ) ;
30- }
22+ // this.$on('query' as any, async (e: any) => {
23+ // this.logger.debug(`(${e.duration}ms) ${e.query}`);
24+ // });
25+ // }
3126
32- async enableShutdownHooks ( app : INestApplication ) {
33- this . $on ( 'beforeExit' , async ( ) => {
34- await app . close ( ) ;
35- } ) ;
36- }
27+ // async enableShutdownHooks(app: INestApplication) {
28+ // this.$on('beforeExit', async () => {
29+ // await app.close();
30+ // });
31+ // }
3732
3833 async truncate ( ) {
3934 const records = await this . $queryRawUnsafe < Array < any > > ( `SELECT tablename
You can’t perform that action at this time.
0 commit comments