hasql 1.9.2 → 1.9.3
raw patch · 7 files changed
+191/−4 lines, 7 filesdep ~postgresql-binaryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: postgresql-binary
API changes (from Hackage documentation)
+ Hasql.Decoders: datemultirange :: Value (Multirange Day)
+ Hasql.Decoders: daterange :: Value (Range Day)
+ Hasql.Decoders: int4multirange :: Value (Multirange Int32)
+ Hasql.Decoders: int4range :: Value (Range Int32)
+ Hasql.Decoders: int8multirange :: Value (Multirange Int64)
+ Hasql.Decoders: int8range :: Value (Range Int64)
+ Hasql.Decoders: nummultirange :: Value (Multirange Scientific)
+ Hasql.Decoders: numrange :: Value (Range Scientific)
+ Hasql.Decoders: tsmultirange :: Value (Multirange LocalTime)
+ Hasql.Decoders: tsrange :: Value (Range LocalTime)
+ Hasql.Decoders: tstzmultirange :: Value (Multirange UTCTime)
+ Hasql.Decoders: tstzrange :: Value (Range UTCTime)
+ Hasql.Encoders: datemultirange :: Value (Multirange Day)
+ Hasql.Encoders: daterange :: Value (Range Day)
+ Hasql.Encoders: int4multirange :: Value (Multirange Int32)
+ Hasql.Encoders: int4range :: Value (Range Int32)
+ Hasql.Encoders: int8multirange :: Value (Multirange Int64)
+ Hasql.Encoders: int8range :: Value (Range Int64)
+ Hasql.Encoders: nummultirange :: Value (Multirange Scientific)
+ Hasql.Encoders: numrange :: Value (Range Scientific)
+ Hasql.Encoders: tsmultirange :: Value (Multirange LocalTime)
+ Hasql.Encoders: tsrange :: Value (Range LocalTime)
+ Hasql.Encoders: tstzmultirange :: Value (Multirange UTCTime)
+ Hasql.Encoders: tstzrange :: Value (Range UTCTime)
Files
- hasql.cabal +2/−3
- library/Hasql/Decoders.hs +12/−0
- library/Hasql/Decoders/All.hs +73/−0
- library/Hasql/Encoders.hs +12/−0
- library/Hasql/Encoders/All.hs +73/−0
- library/Hasql/Errors.hs +1/−1
- library/Hasql/PostgresTypeInfo.hs +18/−0
hasql.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: hasql-version: 1.9.2+version: 1.9.3 category: Hasql, Database, PostgreSQL synopsis: Fast PostgreSQL driver with a flexible mapping API description:@@ -46,7 +46,6 @@ ConstraintKinds DataKinds DefaultSignatures- DeriveDataTypeable DeriveFoldable DeriveFunctor DeriveGeneric@@ -150,7 +149,7 @@ hashtables >=1.1 && <2, iproute >=1.7 && <1.8, mtl >=2 && <3,- postgresql-binary >=0.14.1 && <0.15,+ postgresql-binary >=0.14.2 && <0.15, postgresql-libpq >=0.10.1 && <0.12, profunctors >=5.1 && <6, scientific >=0.3 && <0.4,
library/Hasql/Decoders.hs view
@@ -50,6 +50,18 @@ jsonBytes, jsonb, jsonbBytes,+ int4range,+ int8range,+ numrange,+ tsrange,+ tstzrange,+ daterange,+ int4multirange,+ int8multirange,+ nummultirange,+ tsmultirange,+ tstzmultirange,+ datemultirange, array, listArray, vectorArray,
library/Hasql/Decoders/All.hs view
@@ -14,6 +14,7 @@ import Hasql.Prelude hiding (bool, maybe) import Hasql.Prelude qualified as Prelude import PostgreSQL.Binary.Decoding qualified as A+import PostgreSQL.Binary.Range qualified as R -- * Result @@ -292,6 +293,78 @@ {-# INLINEABLE jsonbBytes #-} jsonbBytes :: (ByteString -> Either Text a) -> Value a jsonbBytes fn = Value (Value.decoder (const (A.jsonb_bytes fn)))++-- |+-- Decoder of the @INT4RANGE@ values.+{-# INLINEABLE int4range #-}+int4range :: Value (R.Range Int32)+int4range = Value (Value.decoder (const A.int4range))++-- |+-- Decoder of the @INT8RANGE@ values.+{-# INLINEABLE int8range #-}+int8range :: Value (R.Range Int64)+int8range = Value (Value.decoder (const A.int8range))++-- |+-- Decoder of the @NUMRANGE@ values.+{-# INLINEABLE numrange #-}+numrange :: Value (R.Range Scientific)+numrange = Value (Value.decoder (const A.numrange))++-- |+-- Decoder of the @TSRANGE@ values.+{-# INLINEABLE tsrange #-}+tsrange :: Value (R.Range LocalTime)+tsrange = Value (Value.decoder (Prelude.bool A.tsrange_float A.tsrange_int))++-- |+-- Decoder of the @TSTZRANGE@ values.+{-# INLINEABLE tstzrange #-}+tstzrange :: Value (R.Range UTCTime)+tstzrange = Value (Value.decoder (Prelude.bool A.tstzrange_float A.tstzrange_int))++-- |+-- Decoder of the @DATERANGE@ values.+{-# INLINEABLE daterange #-}+daterange :: Value (R.Range Day)+daterange = Value (Value.decoder (const A.daterange))++-- |+-- Decoder of the @INT4MULTIRANGE@ values.+{-# INLINEABLE int4multirange #-}+int4multirange :: Value (R.Multirange Int32)+int4multirange = Value (Value.decoder (const A.int4multirange))++-- |+-- Decoder of the @INT8MULTIRANGE@ values.+{-# INLINEABLE int8multirange #-}+int8multirange :: Value (R.Multirange Int64)+int8multirange = Value (Value.decoder (const A.int8multirange))++-- |+-- Decoder of the @NUMMULTIRANGE@ values.+{-# INLINEABLE nummultirange #-}+nummultirange :: Value (R.Multirange Scientific)+nummultirange = Value (Value.decoder (const A.nummultirange))++-- |+-- Decoder of the @TSMULTIRANGE@ values.+{-# INLINEABLE tsmultirange #-}+tsmultirange :: Value (R.Multirange LocalTime)+tsmultirange = Value (Value.decoder (Prelude.bool A.tsmultirange_float A.tsmultirange_int))++-- |+-- Decoder of the @TSTZMULTIRANGE@ values.+{-# INLINEABLE tstzmultirange #-}+tstzmultirange :: Value (R.Multirange UTCTime)+tstzmultirange = Value (Value.decoder (Prelude.bool A.tstzmultirange_float A.tstzmultirange_int))++-- |+-- Decoder of the @DATEMULTIRANGE@ values.+{-# INLINEABLE datemultirange #-}+datemultirange :: Value (R.Multirange Day)+datemultirange = Value (Value.decoder (const A.datemultirange)) -- | -- Lift a custom value decoder function to a 'Value' decoder.
library/Hasql/Encoders.hs view
@@ -41,6 +41,18 @@ jsonb, jsonbBytes, jsonbLazyBytes,+ int4range,+ int8range,+ numrange,+ tsrange,+ tstzrange,+ daterange,+ int4multirange,+ int8multirange,+ nummultirange,+ tsmultirange,+ tstzmultirange,+ datemultirange, name, oid, enum,
library/Hasql/Encoders/All.hs view
@@ -12,6 +12,7 @@ import Hasql.Prelude hiding (bool) import Hasql.Prelude qualified as Prelude import PostgreSQL.Binary.Encoding qualified as A+import PostgreSQL.Binary.Range qualified as R import TextBuilder qualified as C -- * Parameters Product Encoder@@ -270,6 +271,78 @@ {-# INLINEABLE name #-} name :: Value Text name = Value (Value.unsafePTIWithShow PTI.name (const A.text_strict))++-- |+-- Encoder of @INT4RANGE@ values.+{-# INLINEABLE int4range #-}+int4range :: Value (R.Range Int32)+int4range = Value (Value.unsafePTIWithShow PTI.int4range (const A.int4range))++-- |+-- Encoder of @INT8RANGE@ values.+{-# INLINEABLE int8range #-}+int8range :: Value (R.Range Int64)+int8range = Value (Value.unsafePTIWithShow PTI.int8range (const A.int8range))++-- |+-- Encoder of @NUMRANGE@ values.+{-# INLINEABLE numrange #-}+numrange :: Value (R.Range Scientific)+numrange = Value (Value.unsafePTIWithShow PTI.numrange (const A.numrange))++-- |+-- Encoder of @TSRANGE@ values.+{-# INLINEABLE tsrange #-}+tsrange :: Value (R.Range LocalTime)+tsrange = Value (Value.unsafePTIWithShow PTI.tsrange (Prelude.bool A.tsrange_float A.tsrange_int))++-- |+-- Encoder of @TSTZRANGE@ values.+{-# INLINEABLE tstzrange #-}+tstzrange :: Value (R.Range UTCTime)+tstzrange = Value (Value.unsafePTIWithShow PTI.tstzrange (Prelude.bool A.tstzrange_float A.tstzrange_int))++-- |+-- Encoder of @DATERANGE@ values.+{-# INLINEABLE daterange #-}+daterange :: Value (R.Range Day)+daterange = Value (Value.unsafePTIWithShow PTI.daterange (const A.daterange))++-- |+-- Encoder of @INT4MULTIRANGE@ values.+{-# INLINEABLE int4multirange #-}+int4multirange :: Value (R.Multirange Int32)+int4multirange = Value (Value.unsafePTIWithShow PTI.int4multirange (const A.int4multirange))++-- |+-- Encoder of @INT8MULTIRANGE@ values.+{-# INLINEABLE int8multirange #-}+int8multirange :: Value (R.Multirange Int64)+int8multirange = Value (Value.unsafePTIWithShow PTI.int8multirange (const A.int8multirange))++-- |+-- Encoder of @NUMMULTIRANGE@ values.+{-# INLINEABLE nummultirange #-}+nummultirange :: Value (R.Multirange Scientific)+nummultirange = Value (Value.unsafePTIWithShow PTI.nummultirange (const A.nummultirange))++-- |+-- Encoder of @TSMULTIRANGE@ values.+{-# INLINEABLE tsmultirange #-}+tsmultirange :: Value (R.Multirange LocalTime)+tsmultirange = Value (Value.unsafePTIWithShow PTI.tsmultirange (Prelude.bool A.tsmultirange_float A.tsmultirange_int))++-- |+-- Encoder of @TSTZMULTIRANGE@ values.+{-# INLINEABLE tstzmultirange #-}+tstzmultirange :: Value (R.Multirange UTCTime)+tstzmultirange = Value (Value.unsafePTIWithShow PTI.tstzmultirange (Prelude.bool A.tstzmultirange_float A.tstzmultirange_int))++-- |+-- Encoder of @DATEMULTIRANGE@ values.+{-# INLINEABLE datemultirange #-}+datemultirange :: Value (R.Multirange Day)+datemultirange = Value (Value.unsafePTIWithShow PTI.datemultirange (const A.datemultirange)) -- | -- Given a function,
library/Hasql/Errors.hs view
@@ -18,7 +18,7 @@ PipelineError -- | Error details. CommandError- deriving (Show, Eq, Typeable)+ deriving (Show, Eq) instance Exception SessionError where displayException = \case
library/Hasql/PostgresTypeInfo.hs view
@@ -61,6 +61,9 @@ daterange :: PTI daterange = mkPTI LibPQ.Binary 3912 (Just 3913) +datemultirange :: PTI+datemultirange = mkPTI LibPQ.Binary 4535 (Just 6155)+ float4 :: PTI float4 = mkPTI LibPQ.Binary 700 (Just 1021) @@ -85,12 +88,18 @@ int4range :: PTI int4range = mkPTI LibPQ.Binary 3904 (Just 3905) +int4multirange :: PTI+int4multirange = mkPTI LibPQ.Binary 4451 (Just 6150)+ int8 :: PTI int8 = mkPTI LibPQ.Binary 20 (Just 1016) int8range :: PTI int8range = mkPTI LibPQ.Binary 3926 (Just 3927) +int8multirange :: PTI+int8multirange = mkPTI LibPQ.Binary 4536 (Just 6157)+ interval :: PTI interval = mkPTI LibPQ.Binary 1186 (Just 1187) @@ -121,6 +130,9 @@ numrange :: PTI numrange = mkPTI LibPQ.Binary 3906 (Just 3907) +nummultirange :: PTI+nummultirange = mkPTI LibPQ.Binary 4532 (Just 6151)+ oid :: PTI oid = mkPTI LibPQ.Binary 26 (Just 1028) @@ -196,8 +208,14 @@ tsrange :: PTI tsrange = mkPTI LibPQ.Binary 3908 (Just 3909) +tsmultirange :: PTI+tsmultirange = mkPTI LibPQ.Binary 4533 (Just 6152)+ tstzrange :: PTI tstzrange = mkPTI LibPQ.Binary 3910 (Just 3911)++tstzmultirange :: PTI+tstzmultirange = mkPTI LibPQ.Binary 4534 (Just 6153) tsvector :: PTI tsvector = mkPTI LibPQ.Binary 3614 (Just 3643)