chore(lib): add prisma client initialization

This commit is contained in:
cfngc4594 2025-03-06 11:29:10 +08:00
parent aacd5dccde
commit 214f4fabef

11
src/lib/prisma.ts Normal file
View File

@ -0,0 +1,11 @@
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
const globalForPrisma = global as unknown as { prisma: typeof prisma };
if (process.env.NODE_ENV !== 'production') {
globalForPrisma.prisma = prisma;
}
export default prisma;