You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const row = em.customBatchedQuery(`
SELECT
ps.id,
COUNT(*) as total_pi,
SUM(CASE pi.bought_out_status_id WHEN 1 THEN 1 ELSE 0 END) as bought_out_pi
FROM project_stages ps
LEFT OUTER JOIN project_items pi ON pi.project_stage_id = ps.id
WHERE ps.id IN (?)
GROUP BY ps.id
`, ps.untaggedIdOrFail);
If invoked with N ps.untaggedIdOrFails in the same event loop, this would be 1 DB query.
The convention would be that whatever the input parameter is (the single number/text of the 2nd param), must be the 1st column of the custom query, so that the implementation would knows how to partition out the single big result back to each individual caller.
This is stock dataloader functionality, the idea is to just provide a nicer API that is also scoped to the EntityManagers existing connection/lifecycle/etc.
The text was updated successfully, but these errors were encountered:
I.e. something like:
If invoked with N
ps.untaggedIdOrFail
s in the same event loop, this would be 1 DB query.The convention would be that whatever the input parameter is (the single number/text of the 2nd param), must be the 1st column of the custom query, so that the implementation would knows how to partition out the single big result back to each individual caller.
This is stock dataloader functionality, the idea is to just provide a nicer API that is also scoped to the
EntityManager
s existing connection/lifecycle/etc.The text was updated successfully, but these errors were encountered: