hi all, I'm using prisma and agenda to run jobs, i...
# orm-help
j
hi all, I'm using prisma and agenda to run jobs, in each job I create new instance of prisma by
const prisma = new PrismaClient()
and connect to portgres on GCP, but I got error in connection in job as below
Copy code
Error in connector: Error querying the database: db error: FATAL: remaining connection slots are reserved for non-replication superuser connections
How can I manage connection to database efficient to avoid get many connection? thank you
n
Hey John 👋 You can explicitly set the connection limit to 1 by appending the
connection_limit
parameter to the connection string. This would make sure that only 1 connection is used. You can read more about it here Can you try this solution and see if it works for you?