mirror of
https://github.com/Kevsl/crypto-exchange-api.git
synced 2026-02-08 19:16:13 +01:00
testing all features
This commit is contained in:
9
src/prisma/prisma.module.ts
Normal file
9
src/prisma/prisma.module.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Global, Module } from '@nestjs/common';
|
||||
import { PrismaService } from './prisma.service';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
providers: [PrismaService],
|
||||
exports: [PrismaService],
|
||||
})
|
||||
export class PrismaModule {}
|
||||
23
src/prisma/prisma.service.ts
Normal file
23
src/prisma/prisma.service.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { ConfigService } from '@nestjs/config';
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
@Injectable()
|
||||
export class PrismaService extends PrismaClient {
|
||||
constructor(config: ConfigService) {
|
||||
super({
|
||||
datasources: {
|
||||
db: {
|
||||
url: config.get('DATABASE_URL'),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// cleanDb() {
|
||||
// return this.$transaction([
|
||||
// this.bookmark.deleteMany(),
|
||||
// this.user.deleteMany(),
|
||||
// ])
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user