created at 2023/07/08 04:03:49
updated at 2023/07/29 03:38:24
TypeScript
import { PrismaClient } from "@prisma/client";
declare global {
namespace globalThis {
var prisma: PrismaClient;
}
}
TypeScript
import { PrismaClient } from "@prisma/client";
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV === "production") global.prisma = prisma;
export default prisma;