{-# language FlexibleContexts #-}
module Rel8.Query.Set
( union, unionAll
, intersect, intersectAll
, except, exceptAll
)
where
import Prelude ()
import qualified Opaleye.Binary as Opaleye
import Rel8.Expr ( Expr )
import {-# SOURCE #-} Rel8.Query ( Query )
import Rel8.Query.Opaleye ( zipOpaleyeWith )
import Rel8.Table ( Table )
import Rel8.Table.Eq ( EqTable )
import Rel8.Table.Opaleye ( binaryspec )
union :: EqTable a => Query a -> Query a -> Query a
union :: Query a -> Query a -> Query a
union = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.unionExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)
unionAll :: Table Expr a => Query a -> Query a -> Query a
unionAll :: Query a -> Query a -> Query a
unionAll = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.unionAllExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)
intersect :: EqTable a => Query a -> Query a -> Query a
intersect :: Query a -> Query a -> Query a
intersect = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.intersectExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)
intersectAll :: EqTable a => Query a -> Query a -> Query a
intersectAll :: Query a -> Query a -> Query a
intersectAll = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.intersectAllExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)
except :: EqTable a => Query a -> Query a -> Query a
except :: Query a -> Query a -> Query a
except = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.exceptExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)
exceptAll :: EqTable a => Query a -> Query a -> Query a
exceptAll :: Query a -> Query a -> Query a
exceptAll = (Select a -> Select a -> Select a) -> Query a -> Query a -> Query a
forall a b c.
(Select a -> Select b -> Select c) -> Query a -> Query b -> Query c
zipOpaleyeWith (Binaryspec a a -> Select a -> Select a -> Select a
forall fields fields'.
Binaryspec fields fields'
-> Select fields -> Select fields -> Select fields'
Opaleye.exceptAllExplicit Binaryspec a a
forall a. Table Expr a => Binaryspec a a
binaryspec)