ocsigen / macaque

Other
38 stars 12 forks source link

Subqueries #10

Open kit-ty-kate opened 10 years ago

kit-ty-kate commented 10 years ago

As discussed earlier, we heavily need subqueries (or EXTERNAL JOIN) like:

let sub l = <:view< group { tags = array_agg[t.name] } | t in $tags$; something with l and t >> in
Query.view db <:view< { tags = one ($sub$ l); l.id } | l in $links$ >>

So I'm making this issue to discuss and have feedbacks. I'll be glad to help if you need.

kit-ty-kate commented 10 years ago

I'll try with unions for the moment. I'll see if it fills my needs.

gasche commented 10 years ago

I've been working on this, but it is rather hard to implement, because of the interaction with flattening in particular (go have a look at sql_flatten.ml for one of the most complex parts of Macaque), so I will need a few more days.