LuCrypto
LuCrypto
PPrisma
Created by LuCrypto on 5/8/2024 in #help-and-questions
npm migrate deploy Error
No description
2 replies
PPrisma
Created by LuCrypto on 4/29/2024 in #help-and-questions
Prisma too many connection to my database
Hey everyone, I use Prisma for ORM and Neon for my database I noticed something, my connections aren't unique and after some time, i reach to the max to my database But i throught i'd solved the problem by doing this : I have this file and i only imported prisma from this file in my project prisma.ts
import { PrismaClient } from '@prisma/client'

const prismaClientSingleton = () => {
return new PrismaClient()
}

declare global {
var prismaGlobal: undefined | ReturnType<typeof prismaClientSingleton>
}

export const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()

if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma
import { PrismaClient } from '@prisma/client'

const prismaClientSingleton = () => {
return new PrismaClient()
}

declare global {
var prismaGlobal: undefined | ReturnType<typeof prismaClientSingleton>
}

export const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()

if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma
Why do I have so many connections? Thanks in advance for your help
14 replies