import { PrismaClient } from '@prisma/client';declare global { // eslint-disable-next-line no-var var prisma: PrismaClient | undefined;}export let prisma = global.prisma || new PrismaClient({ log: process.env.NODE_ENV === 'development' ? ['error', 'warn'] : ['error'], });if (process.env.NODE_ENV !== 'production') { global.prisma = prisma;}
export const createTRPCContext = async (opts: { headers: Headers }) => { const session = await getServerAuthSession(); return { session, prisma, ...opts, };};