1 {-# LANGUAGE FlexibleInstances #-}
2 {-# LANGUAGE MultiParamTypeClasses #-}
3 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Gargantext.Database.Instances where
7 import Gargantext.Prelude
9 import Data.Text (Text)
10 import Data.Time (UTCTime)
12 import Opaleye (PGInt4, PGTimestamptz, PGFloat8
13 , QueryRunnerColumnDefault
14 , queryRunnerColumnDefault
15 , fieldQueryRunnerColumn
18 instance QueryRunnerColumnDefault PGInt4 Integer where
19 queryRunnerColumnDefault = fieldQueryRunnerColumn
21 instance QueryRunnerColumnDefault PGFloat8 (Maybe Double) where
22 queryRunnerColumnDefault = fieldQueryRunnerColumn
24 instance QueryRunnerColumnDefault PGInt4 (Maybe Int) where
25 queryRunnerColumnDefault = fieldQueryRunnerColumn
27 instance QueryRunnerColumnDefault PGTimestamptz (Maybe UTCTime) where
28 queryRunnerColumnDefault = fieldQueryRunnerColumn
30 instance QueryRunnerColumnDefault (Nullable PGInt4) Int where
31 queryRunnerColumnDefault = fieldQueryRunnerColumn
33 instance QueryRunnerColumnDefault (Nullable PGText) Text where
34 queryRunnerColumnDefault = fieldQueryRunnerColumn