Skip to content

Instantly share code, notes, and snippets.

@chenkie
Created June 29, 2021 16:15
Show Gist options
  • Save chenkie/ed41296503ce164284ef009cb29462fa to your computer and use it in GitHub Desktop.
Save chenkie/ed41296503ce164284ef009cb29462fa to your computer and use it in GitHub Desktop.
import { PrismaClient } from '@prisma/client';
const prisma = global.prisma || new PrismaClient();
if (process.env.NODE_ENV === 'development') global.prisma = prisma;
export default prisma;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment