jhc-systems / sqlest

Write SQL in Scala
https://jhc-systems.github.io/sqlest/latest/api/
Apache License 2.0
30 stars 17 forks source link

Add `union` and `union all` #11

Closed brendanator closed 9 years ago

brendanator commented 10 years ago

Select[A] should have new parameter union: List[Union[A]]

case class Union[A](select: Select[A], unionAll: Boolean)

Select[A] is parameterised by the columns being selected. Therefore as long as both Selects in a union or unionAll have the same type parameter the generated sql will run correctly

There is an open question as to how extractors will interact with a unioned select statement as currently they overwrite the columns being selected

mapColumns will need to be updated to handle the new unioned select statement