feat: set up prisma db

This commit is contained in:
micha 2025-05-14 17:22:01 +02:00 committed by Dominik
parent 9f8dd69987
commit 8ef0ea17d4
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