cal.pub0.org/packages/prisma/index.ts

18 lines
322 B
TypeScript
Raw Normal View History

import { PrismaClient } from "@prisma/client";
2022-02-24 01:14:37 +00:00
declare global {
var prisma: PrismaClient | undefined;
2022-02-24 01:14:37 +00:00
}
export const prisma =
globalThis.prisma ||
new PrismaClient({
// log: ["query", "error", "warn"],
});
if (process.env.NODE_ENV !== "production") {
globalThis.prisma = prisma;
}
export default prisma;