first commit
This commit is contained in:
12
nest-websocket/lib/db.ts
Normal file
12
nest-websocket/lib/db.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var prisma: PrismaClient | undefined;
|
||||
}
|
||||
|
||||
export const db = globalThis.prisma || new PrismaClient();
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
globalThis.prisma = db;
|
||||
}
|
||||
Reference in New Issue
Block a user