What is the easiest way to query many tuples with composite key in ROM SQL?
Given a dataset with say (product_id, position)
and an array of tuples
[
{ product_id: 10, position: 1},
{ product_id: 11, position: 2}
]
I am looking for the easiest way to query only those tuples, that match both values. Obviously this is a disjunction of many conjunctions, but I haven’t found how to query for it in a canonical way.
EDIT
Shall I build a query like that:
tuples[1..].inject(dataset.where(tuples[0])) { |q, t| q.or(t) }
?