P
Prisma10mo ago
ptrxyz

Multiple Prisma clients and connection pooling

I would like to use multiple Prisma clients in my application, basically like so:
const p1 = new PrismaClient({config})
const p2 = new PrismaClient({config})
const p1 = new PrismaClient({config})
const p2 = new PrismaClient({config})
I wonder if they share the same connection pool and when they connect to the database. Does Prisma connect on first query or as soon as you create the client? And in my example, do p1 and p2 connect separately and keep different connection pools or do they share the same underlying pool since they both use the same configuration?
1 Reply
ptrxyz
ptrxyzOP10mo ago
Want results from more Discord servers?
Add your server