mirror of
https://github.com/acedanger/finance.git
synced 2025-12-05 22:50:12 -08:00
transitioned from astro to react
This commit is contained in:
13
server/data/prisma.ts
Normal file
13
server/data/prisma.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
|
||||
// Prevent multiple instances of Prisma Client in development
|
||||
declare global {
|
||||
// eslint-disable-next-line no-var
|
||||
var prismaClient: PrismaClient | undefined;
|
||||
}
|
||||
|
||||
export const prisma = global.prismaClient || new PrismaClient();
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
global.prismaClient = prisma;
|
||||
}
|
||||
Reference in New Issue
Block a user