Filtering across many different queries

Hello and welcome,

It’s usually easier to provide some kind of MVP for question with complex environment to reproduce…

Anyway, Ecto is quite close to SQL, and your queries do not look complicate.

I hope You are not doing one context per controller, or schema…

Also queries are highly composable, how do You compose them?

I use a reduce method, to pack all queries into one… that can be processed.

There are some examples on the site on how to proceed.