Newer
Older

DESKTOP-9FO96TP\hehexd
committed
declare global {
// eslint-disable-next-line no-var
var cachedPrisma: PrismaClient

DESKTOP-9FO96TP\hehexd
committed
}
let prisma: PrismaClient
if (process.env.NODE_ENV === "production") {
prisma = new PrismaClient()
} else {
if (!global.cachedPrisma) {
global.cachedPrisma = new PrismaClient()
}
prisma = global.cachedPrisma
}

DESKTOP-9FO96TP\hehexd
committed