Dental Care

This commit is contained in:
Iliyan Angelov
2025-11-16 14:29:51 +02:00
commit 39077550ef
194 changed files with 43197 additions and 0 deletions

19
lib/types/prisma.ts Normal file
View File

@@ -0,0 +1,19 @@
import { PrismaClient } from '@prisma/client'
const globalForPrisma = globalThis as unknown as {
prisma: PrismaClient | undefined
}
/**
* Prisma Client Configuration
*
* Important for MongoDB:
* - No connection pooling needed (MongoDB handles it)
* - Ensure DATABASE_URL uses mongodb:// or mongodb+srv:// protocol
* - Disable Prisma Accelerate (not compatible with MongoDB)
*/
export const prisma = globalForPrisma.prisma ?? new PrismaClient({
log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
})
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma