T
tRPC

How would batching result in a single database query?

How would batching result in a single database query?

DDavid7/25/2023
On the 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:
AKAlex / KATT 🐱7/25/2023
DDavid7/26/2023
Thank you! Is there some example code for this using trpc?

Looking for more? Join the community!

T
tRPC

How would batching result in a single database query?

Join Server