NextJSNetflix/lib/prismadb.tsx

6 lines
194 B
TypeScript

import { PrismaClient } from "@prisma/client";
const client = global.prismadb || new PrismaClient();
if (process.env.NODE_ENV === 'production') global.prismadb = client;
export default client;