Created
November 27, 2023 09:17
-
-
Save dninomiya/773a5cec5629b38b73c218895703b289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from '@prisma/client'; | |
declare global { | |
var prisma: PrismaClient | undefined; | |
} | |
const prisma = global.prisma || new PrismaClient(); | |
if (process.env.NODE_ENV === 'development') global.prisma = prisma; | |
export const db = prisma; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment