Skip to content

Instantly share code, notes, and snippets.

@codigoconjuan
Created November 10, 2025 19:12
Show Gist options
  • Select an option

  • Save codigoconjuan/1de865ab01deec9bf068b156363206c4 to your computer and use it in GitHub Desktop.

Select an option

Save codigoconjuan/1de865ab01deec9bf068b156363206c4 to your computer and use it in GitHub Desktop.
Cliente de Conexiones Prisma
import { PrismaClient } from '@/src/generated/prisma/client'
const globalForPrisma = global as unknown as { prisma: PrismaClient }
export const prisma =
globalForPrisma.prisma ||
new PrismaClient({
log: ['query'],
})
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment