Hello again!
Within less than a day I realized that my advantures haven’t finished yet
Yesterday I asked a question about binding joins and - thanks to the docs and José Valim - found an answer.
But now I have another obstacle. I need to solve it in the same way (subsequent parse and extending base query) as in the prevoius question by the link above.
For example, I can make an SQL query like this:
SELECT *
FROM cities as c
WHERE c.founded > '1900-01-01' AND c.founded < '1950-12-31' AND (c.population > 1000000 OR c.has_landmark = true)
If I would do it in the one query, I build it like this: q = from c in Cities, where: c.founded > ^date1 and c.founded < ^date2 and (c.population > 1000000 or c.has_landmark = true)
But how to do it in subsequent passes? I will have a number of AND parts as well as a number of OR parts. I can pipe AND parts first and OR pass after. There will joins in addition to almost every where/or_where clauses.
So, is it possible to do it subsequently or it’s only possible to build the whole query at once with that conditions?
Many thanks in advance!