yo-next-auth/lib/db.ts

10 lines
265 B
TypeScript

import { PrismaClient } from '@prisma/client'
import * as process from 'process'
declare global {
var prisma: PrismaClient | undefined
}
export const db = globalThis.prisma || new PrismaClient()
if (process.env.NODE_ENV !== 'production') globalThis.prisma = db