mirror of
https://github.com/massbug/judge4c.git
synced 2026-10-15 15:17:31 +00:00
chore(lib): add prisma client initialization
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user