tRPCttRPC
Powered by
DavidD
tRPC•3y ago•
4 replies
David

How would batching result in a single database query?

On the
httpBatchStreamLink
httpBatchStreamLink
docs it says that multiple query calls could result in a single database query. How would that work? Should you expect the passed input to possibly be an array to allow for this?
After that, you can make use of batching by setting all your procedures in a Promise.all. The code below will produce exactly one HTTP request and on the server exactly one database query:
After that, you can make use of batching by setting all your procedures in a Promise.all. The code below will produce exactly one HTTP request and on the server exactly one database query:
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Possible to disable batching on a single query?
Answer OverflowAAnswer Overflow / ❓-help
2y ago
trpc/react-query batching
KimblisKKimblis / ❓-help
3y ago
how does batching work?
hachoterHhachoter / ❓-help
3y ago