R
Railway5mo ago
Garcia

Problem with Prisma

I have a problem with prisma and my db PostgreSql, whats i can resolve this? Error querying the database: FATAL: sorry, too many clients already My database url contains: ?connection_limit=20&pool_timeout=0&connect_timeout=300
10 Replies
Percy
Percy5mo ago
Project ID: 8140907c-d91e-4495-8289-d77c9283a314
Garcia
Garcia5mo ago
8140907c-d91e-4495-8289-d77c9283a314
Brody
Brody5mo ago
are you connecting to your database from a serverless environment like vercel?
Garcia
Garcia5mo ago
i connect simply, using database url, with my project containing my db and my back-end, with NestJS and Prisma its direct connection
Brody
Brody5mo ago
so the app that is connecting to the database is hosted on railway
Garcia
Garcia5mo ago
yes
Brody
Brody5mo ago
you might be opening a new connection for every query, maybe check out this docs page https://www.prisma.io/docs/orm/more/help-and-troubleshooting/help-articles/nextjs-prisma-client-dev-practices
Garcia
Garcia5mo ago
my project is with nestjs, but its maybe resolved my problem, thanks
Brody
Brody5mo ago
yep should still be applicable at a high level
Garcia
Garcia5mo ago
ok