]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Database/Query/Filter.hs
[WIP] backup during the vacations
[gargantext.git] / src / Gargantext / Database / Query / Filter.hs
1 {-|
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
8 Portability : POSIX
9 -}
10
11
12
13 {-# LANGUAGE Arrows #-}
14 {-# LANGUAGE FunctionalDependencies #-}
15 {-# LANGUAGE TemplateHaskell #-}
16 {-# OPTIONS_GHC -fno-warn-orphans #-}
17
18 module Gargantext.Database.Query.Filter
19 where
20
21 import Gargantext.Core.Types (Limit, Offset)
22 import Data.Maybe (Maybe, maybe)
23 import Opaleye (Select, limit, offset)
24
25 limit' :: Maybe Limit -> Select a -> Select a
26 limit' maybeLimit query = maybe query (\l -> limit l query) maybeLimit
27
28 offset' :: Maybe Offset -> Select a -> Select a
29 offset' maybeOffset query = maybe query (\o -> offset o query) maybeOffset
30
31