calcom/lib/prisma.ts
Mihai C 80a2b6c068
chore: clean up and fix images (#1224)
Co-authored-by: Bailey Pumfleet <pumfleet@hey.com>
2021-12-01 10:32:08 +00:00

20 lines
389 B
TypeScript

import { PrismaClient } from "@prisma/client";
import { IS_PRODUCTION } from "@lib/config/constants";
declare global {
// eslint-disable-next-line no-var
var prisma: PrismaClient | undefined;
}
export const prisma =
globalThis.prisma ||
new PrismaClient({
log: ["query", "error", "warn"],
});
if (!IS_PRODUCTION) {
globalThis.prisma = prisma;
}
export default prisma;