001
This commit is contained in:
commit
73ea49c3fe
16 changed files with 2746 additions and 0 deletions
9
backend/src/lib/prisma.ts
Normal file
9
backend/src/lib/prisma.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
const globalForPrisma = globalThis as unknown as {
|
||||
prisma: PrismaClient | undefined;
|
||||
};
|
||||
|
||||
export const prisma = globalForPrisma.prisma ?? new PrismaClient();
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
Loading…
Add table
Add a link
Reference in a new issue