Paul Brinkmeier 4bf489c554 Implement UTCTime decoding
Remove LocalTime decoding because it requires IO to convert from Postgres time.
2024-01-08 15:28:14 +01:00

67 lines
1.1 KiB
Haskell

module Database.PostgreSQL.Opium.Oid where
import Database.PostgreSQL.LibPQ (Oid (..))
eq :: Eq a => a -> a -> Bool
eq = (==)
-- raw byte string
bytea :: Oid -> Bool
bytea = eq $ Oid 17
-- string types
text :: Oid -> Bool
text = eq $ Oid 25
character :: Oid -> Bool
character = eq $ Oid 1042
characterVarying :: Oid -> Bool
characterVarying = eq $ Oid 1043
-- integer types
-- | 16-bit integer
smallint :: Oid -> Bool
smallint = eq $ Oid 21
-- | 32-bit integer
integer :: Oid -> Bool
integer = eq $ Oid 23
-- | 64-bit integer
bigint :: Oid -> Bool
bigint = eq $ Oid 20
-- floating point types
-- | 32-bit IEEE float
real :: Oid -> Bool
real = eq $ Oid 700
-- | 64-bit IEEE float
doublePrecision :: Oid -> Bool
doublePrecision = eq $ Oid 701
-- | Boolean
boolean :: Oid -> Bool
boolean = eq $ Oid 16
-- | Single days/dates.
date :: Oid -> Bool
date = eq $ Oid 1082
-- | Time of day.
time :: Oid -> Bool
time = eq $ Oid 1083
-- | A point in time.
timestamp :: Oid -> Bool
timestamp = eq $ Oid 1114
-- | A point in time.
timestampWithTimezone :: Oid -> Bool
timestampWithTimezone = eq $ Oid 1184