module Rel8.Query.Limit
( limit
, offset
)
where
import Prelude
import qualified Opaleye
import Rel8.Query ( Query )
import Rel8.Query.Opaleye ( mapOpaleye )
limit :: Word -> Query a -> Query a
limit :: Word -> Query a -> Query a
limit = (Select a -> Select a) -> Query a -> Query a
forall a b. (Select a -> Select b) -> Query a -> Query b
mapOpaleye ((Select a -> Select a) -> Query a -> Query a)
-> (Word -> Select a -> Select a) -> Word -> Query a -> Query a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Select a -> Select a
forall a. Int -> Select a -> Select a
Opaleye.limit (Int -> Select a -> Select a)
-> (Word -> Int) -> Word -> Select a -> Select a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral
offset :: Word -> Query a -> Query a
offset :: Word -> Query a -> Query a
offset = (Select a -> Select a) -> Query a -> Query a
forall a b. (Select a -> Select b) -> Query a -> Query b
mapOpaleye ((Select a -> Select a) -> Query a -> Query a)
-> (Word -> Select a -> Select a) -> Word -> Query a -> Query a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Select a -> Select a
forall a. Int -> Select a -> Select a
Opaleye.offset (Int -> Select a -> Select a)
-> (Word -> Int) -> Word -> Select a -> Select a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Word -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral