mirror of
https://github.com/vas3k/TaxHacker.git
synced 2026-01-08 22:50:33 -06:00
10 lines
323 B
TypeScript
10 lines
323 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
|