Araq / ormin

Ormin -- An ORM for Nim.
MIT License
152 stars 18 forks source link

Supported for having in subquery #38

Closed huaxk closed 4 years ago

huaxk commented 4 years ago

Ormin supports having clause,like:

    let countvalue = 2
    let res = query:
      select post(author, count(id) as count)
      groupby author
      having count(id) >= ?countvalue

but does not support using having clauses in subquery, like:

    let
      id1 = 2
      id2 = 3
    let res = query:
      select thread(count(_))
      where id in (
        select post(thread) where (author == ?id1 or author == ?id2) and id in (
          select post(min(id)) groupby thread having min(id) > 3))

I try to add this feature.