2 Module : Gargantext.Database.Queries.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
11 {-# OPTIONS_GHC -fno-warn-name-shadowing #-}
13 {-# LANGUAGE Arrows #-}
14 {-# LANGUAGE DeriveGeneric #-}
15 {-# LANGUAGE FlexibleInstances #-}
16 {-# LANGUAGE FunctionalDependencies #-}
17 {-# LANGUAGE MultiParamTypeClasses #-}
18 {-# LANGUAGE NoImplicitPrelude #-}
19 {-# LANGUAGE TemplateHaskell #-}
20 {-# OPTIONS_GHC -fno-warn-orphans #-}
22 module Gargantext.Database.Queries.Filter where
24 import Gargantext.Core.Types (Limit, Offset)
25 import Data.Maybe (Maybe, maybe)
26 import Opaleye (Query, limit, offset)
28 limit' :: Maybe Limit -> Query a -> Query a
29 limit' maybeLimit query = maybe query (\l -> limit l query) maybeLimit
31 offset' :: Maybe Offset -> Query a -> Query a
32 offset' maybeOffset query = maybe query (\o -> offset o query) maybeOffset