on 3c5f54c help sign in
rel8/src/Rel8/Query/Set.hs
46 lines 1.2 kB history raw
1{-# language FlexibleContexts #-}
3module Rel8.Query.Set
4 ( union, unionAll
5 , intersect, intersectAll
6 , except, exceptAll
7 )
8where
10-- base
11import Prelude ()
13-- opaleye
14import qualified Opaleye.Binary as Opaleye
16-- rel8
17import {-# SOURCE #-} Rel8.Query ( Query )
18import Rel8.Query.Opaleye ( zipOpaleyeWith )
19import Rel8.Table ( Table )
20import Rel8.Table.Eq ( EqTable )
21import Rel8.Table.Opaleye ( binaryspec )
22import Rel8.Schema.Context ( DB )
25union :: EqTable a => Query a -> Query a -> Query a
26union = zipOpaleyeWith (Opaleye.unionExplicit binaryspec)
29unionAll :: Table DB a => Query a -> Query a -> Query a
30unionAll = zipOpaleyeWith (Opaleye.unionAllExplicit binaryspec)
33intersect :: EqTable a => Query a -> Query a -> Query a
34intersect = zipOpaleyeWith (Opaleye.intersectExplicit binaryspec)
37intersectAll :: Table DB a => Query a -> Query a -> Query a
38intersectAll = zipOpaleyeWith (Opaleye.intersectAllExplicit binaryspec)
41except :: EqTable a => Query a -> Query a -> Query a
42except = zipOpaleyeWith (Opaleye.exceptExplicit binaryspec)
45exceptAll :: Table DB a => Query a -> Query a -> Query a
46exceptAll = zipOpaleyeWith (Opaleye.exceptAllExplicit binaryspec)