feat: set up prisma db

This commit is contained in:
micha 2025-05-14 17:22:01 +02:00
parent 174a6168c0
commit 91e405c11c
7 changed files with 119 additions and 33 deletions

7
src/prisma.ts Normal file
View file

@ -0,0 +1,7 @@
import { PrismaClient } from "@prisma/client"
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient }
export const prisma = globalForPrisma.prisma || new PrismaClient()
if (process.env.NODE_ENV !== "production") globalForPrisma.prisma = prisma