ptrxyz
ptrxyz
Explore posts from servers
PPrisma
Created by ptrxyz on 9/24/2024 in #help-and-questions
concat two Prisma.sql queries.
I have two pretty complex queries which i created manually using
const a = Prisma.sql(...)
const b = Prisma.sql(...)
const a = Prisma.sql(...)
const b = Prisma.sql(...)
In some cases and since both return the same data type, I would like to run them in one go concatenated using (QUERY1) UNION (QUERY2). So, my question is: How can I concat two Prisma.sql queries?
8 replies
PPrisma
Created by ptrxyz on 3/17/2024 in #help-and-questions
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?
2 replies