NextJSNetflix/lib/prismadb.tsx

6 lines
194 B
TypeScript
Raw Normal View History

2023-06-04 12:33:10 +00:00
import { PrismaClient } from "@prisma/client";
const client = global.prismadb || new PrismaClient();
if (process.env.NODE_ENV === 'production') global.prismadb = client;
export default client;