1 {-# LANGUAGE FlexibleInstances #-}
2 {-# LANGUAGE MultiParamTypeClasses #-}
3 {-# OPTIONS_GHC -fno-warn-orphans #-}
5 module Gargantext.Database.Instances where
7 import Gargantext.Prelude
8 import Data.Text (Text)
9 import Data.Time (UTCTime)
10 import Opaleye (PGInt4, PGTimestamptz, PGFloat8
11 , QueryRunnerColumnDefault
12 , queryRunnerColumnDefault
13 , fieldQueryRunnerColumn
16 instance QueryRunnerColumnDefault PGInt4 Integer where
17 queryRunnerColumnDefault = fieldQueryRunnerColumn
19 instance QueryRunnerColumnDefault PGFloat8 (Maybe Double) where
20 queryRunnerColumnDefault = fieldQueryRunnerColumn
22 instance QueryRunnerColumnDefault PGInt4 (Maybe Int) where
23 queryRunnerColumnDefault = fieldQueryRunnerColumn
25 instance QueryRunnerColumnDefault PGTimestamptz (Maybe UTCTime) where
26 queryRunnerColumnDefault = fieldQueryRunnerColumn
28 instance QueryRunnerColumnDefault (Nullable PGInt4) Int where
29 queryRunnerColumnDefault = fieldQueryRunnerColumn
31 instance QueryRunnerColumnDefault (Nullable PGText) Text where
32 queryRunnerColumnDefault = fieldQueryRunnerColumn