Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions postgresql-simple-interval.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ library
build-depends:
persistent ^>=2.17,
scientific ^>=0.3.8,
template-haskell >=2.15 && <2.24,
text >=1.2.4 && <1.3 || >=2.0 && <2.2,

-- cabal-gild: discover source/library
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveLift #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
Expand Down Expand Up @@ -27,6 +28,7 @@ import qualified Database.PostgreSQL.Simple.FromField as Postgres
import qualified Database.PostgreSQL.Simple.ToField as Postgres
import qualified Database.PostgreSQL.Simple.TypeInfo.Static as Postgres
import qualified GHC.TypeLits as TypeLits
import qualified Language.Haskell.TH.Syntax as TH

-- | This type represents a PostgreSQL interval. Intervals can have month, day,
-- and microsecond components. Each component is bounded, so they are not
Expand All @@ -53,7 +55,7 @@ data Interval = MkInterval
days :: !Int.Int32,
microseconds :: !Int.Int64
}
deriving (Eq, Show)
deriving (Eq, TH.Lift, Show)

-- | Uses 'parse'. Ensures that the OID is 'Postgres.intervalOid'.
instance Postgres.FromField Interval where
Expand Down