DavidD
tRPC3y ago
4 replies
David

How would batching result in a single database query?

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:
Was this page helpful?