- Rename /news route to /blog across all pages, links, and sitemap - Fix hardcoded English text in Experiences, QuoteSection, and Footer by wiring all content through the TR/EN dictionaries - Clean up Footer: remove non-existent page links, add contact column - Update contact info: new phone numbers, bilgi@ email, No:71 address, Instagram @ayrisapart link - Add suppressHydrationWarning to <body> to silence browser-extension attribute mismatch errors - Add sizes prop to all fill-mode Next.js Image components Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
720 B
TypeScript
24 lines
720 B
TypeScript
import { PrismaClient } from '@prisma/client'
|
|
import { PrismaPg } from '@prisma/adapter-pg'
|
|
import pg from 'pg'
|
|
|
|
const globalForPrisma = globalThis as unknown as {
|
|
prisma: PrismaClient | undefined
|
|
}
|
|
|
|
// 1. Create a pool or connection using the underlying driver
|
|
const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL })
|
|
|
|
// 2. Wrap it in the Prisma adapter
|
|
const adapter = new PrismaPg(pool)
|
|
|
|
// 3. Pass the adapter to the PrismaClient constructor
|
|
export const prisma =
|
|
globalForPrisma.prisma ??
|
|
new PrismaClient({
|
|
adapter,
|
|
log: process.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
|
|
})
|
|
|
|
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|