fix
This commit is contained in:
parent
bb499a4cc2
commit
642bee440e
1 changed files with 10 additions and 0 deletions
|
|
@ -3,6 +3,16 @@ import { PrismaClient } from '@prisma/client';
|
|||
|
||||
@Injectable()
|
||||
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
||||
constructor() {
|
||||
super({
|
||||
datasources: {
|
||||
db: {
|
||||
url: process.env.DATABASE_URL,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async onModuleInit() {
|
||||
await this.$connect();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue