1
0
mirror of https://github.com/stonith404/pingvin-share.git synced 2024-11-19 05:40:12 +01:00
pingvin-share/backend/src/prisma/prisma.service.ts

19 lines
477 B
TypeScript
Raw Normal View History

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("DB_URL"),
},
},
});
console.log(config.get("DB_URL"));
super.$connect().then(() => console.info("Connected to the database"));
}
}