2 Module : Gargantext.Database.Instances
4 Copyright : (c) CNRS, 2017-Present
5 License : AGPL + CECILL v3
6 Maintainer : team@gargantext.org
7 Stability : experimental
10 Here is a longer description of this module, containing some
11 commentary with @some markup@.
14 {-# OPTIONS_GHC -fno-warn-orphans #-}
16 {-# LANGUAGE FlexibleInstances #-}
17 {-# LANGUAGE MultiParamTypeClasses #-}
18 {-# LANGUAGE NoImplicitPrelude #-}
20 module Gargantext.Database.Instances where
22 import Gargantext.Prelude
24 import Data.Text (Text)
25 import Data.Time (UTCTime)
27 import Opaleye (PGInt4, PGTimestamptz, PGFloat8
28 , QueryRunnerColumnDefault
29 , queryRunnerColumnDefault
30 , fieldQueryRunnerColumn
33 instance QueryRunnerColumnDefault PGInt4 Integer where
34 queryRunnerColumnDefault = fieldQueryRunnerColumn
36 instance QueryRunnerColumnDefault PGFloat8 (Maybe Double) where
37 queryRunnerColumnDefault = fieldQueryRunnerColumn
39 instance QueryRunnerColumnDefault PGInt4 (Maybe Int) where
40 queryRunnerColumnDefault = fieldQueryRunnerColumn
42 instance QueryRunnerColumnDefault PGTimestamptz (Maybe UTCTime) where
43 queryRunnerColumnDefault = fieldQueryRunnerColumn
45 instance QueryRunnerColumnDefault (Nullable PGInt4) Int where
46 queryRunnerColumnDefault = fieldQueryRunnerColumn
48 instance QueryRunnerColumnDefault (Nullable PGText) Text where
49 queryRunnerColumnDefault = fieldQueryRunnerColumn