mirror of
https://github.com/vas3k/TaxHacker.git
synced 2026-07-03 19:19:35 +08:00
10 lines
322 B
TypeScript
10 lines
322 B
TypeScript
import { PrismaClient } from "@prisma/client"
|
|
|
|
const globalForPrisma = globalThis as unknown as {
|
|
prisma: PrismaClient | undefined
|
|
}
|
|
|
|
export const prisma = globalForPrisma.prisma ?? new PrismaClient({ log: ["query", "info", "warn", "error"] })
|
|
|
|
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma
|