Bypass accelerate for certain queries to avoid 5MB limit

We have a reporting page that runs 20 or so queries from the db. We want to use accelerate, but 1-2 of the queries exceed 5MB (Not really a way around it). Is there a way, just for these queries, to tell it to just hit the database directly? I suppose I could spin up a separate prisma client and use datasourceUrl to override it. I don't know if that's an optimal solution, if there are issues with that I'm not considering, or if maybe there's something more elegant.
5 Replies
mikewilliams3mo ago
Update for anyone else who finds this. Appears using two clients is indeed the solution:
Nurul3mo ago
Hey @mikewilliams 👋 Thank you for sharing the solution here 🙂 I have responded to your email.
sauce3mo ago
Thanks for this
mikewilliams3mo ago
@Nurul (Prisma) I actually have a follow up to this. It seems you all recommend using prisma generate --no-engine for accelerate clients. If I'm generating the client, but then creating two clients (one for direct access) as seen above, would I not want to do this?
jonfanz3mo ago
It's after Nurul's day so I'll step in 🙂 That's correct. --no-engine should only be used if your app/project has no need for Prisma query engine(s).
Want results from more Discord servers?
Add your server
More Posts