2 Module : Gargantext.Database.Query.Filter
3 Description : Main requests of Node to the database
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
13 {-# LANGUAGE Arrows #-}
14 {-# LANGUAGE FunctionalDependencies #-}
15 {-# LANGUAGE TemplateHaskell #-}
16 {-# OPTIONS_GHC -fno-warn-orphans #-}
18 module Gargantext.Database.Query.Filter
21 import Gargantext.Core.Types (Limit, Offset)
22 import Data.Maybe (Maybe, maybe)
23 import Opaleye (Select, limit, offset)
25 limit' :: Maybe Limit -> Select a -> Select a
26 limit' maybeLimit query = maybe query (\l -> limit l query) maybeLimit
28 offset' :: Maybe Offset -> Select a -> Select a
29 offset' maybeOffset query = maybe query (\o -> offset o query) maybeOffset