From 377aed77603992d359ac7ec078153a24428b73b5 Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Mon, 24 Jun 2024 09:38:02 +0300 Subject: [PATCH] Move to "iproute" from "network-ip" for the "inet" datatype --- CHANGELOG.md | 4 ++++ cabal.project | 3 +++ hasql.cabal | 4 ++-- library/Hasql/Decoders/All.hs | 4 ++-- library/Hasql/Encoders/All.hs | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48b3b13..e53d863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.8 + +- Move to "iproute" from "network-ip" for the "inet" datatype (#163). + # 1.7 - Decidable instance on `Encoders.Params` removed. It was useless and limited the design. diff --git a/cabal.project b/cabal.project index e6fdbad..778d40a 100644 --- a/cabal.project +++ b/cabal.project @@ -1 +1,4 @@ packages: . +allow-newer: + , *:base + , *:template-haskell diff --git a/hasql.cabal b/hasql.cabal index 48c82bd..6d46500 100644 --- a/hasql.cabal +++ b/hasql.cabal @@ -140,9 +140,9 @@ library dlist >=0.8 && <0.9 || >=1 && <2, hashable >=1.2 && <2, hashtables >=1.1 && <2, + iproute >=1.7 && <1.8, mtl >=2 && <3, - network-ip >=0.3.0.3 && <0.4, - postgresql-binary >=0.13.1 && <0.14, + postgresql-binary >=0.14 && <0.15, postgresql-libpq ==0.10.1.0, profunctors >=5.1 && <6, scientific >=0.3 && <0.4, diff --git a/library/Hasql/Decoders/All.hs b/library/Hasql/Decoders/All.hs index 0281e1f..b61eae9 100644 --- a/library/Hasql/Decoders/All.hs +++ b/library/Hasql/Decoders/All.hs @@ -3,6 +3,7 @@ module Hasql.Decoders.All where import Data.Aeson qualified as Aeson +import Data.IP qualified as Iproute import Data.Vector.Generic qualified as GenericVector import Hasql.Decoders.Array qualified as Array import Hasql.Decoders.Composite qualified as Composite @@ -12,7 +13,6 @@ import Hasql.Decoders.Row qualified as Row import Hasql.Decoders.Value qualified as Value import Hasql.Prelude hiding (bool, maybe) import Hasql.Prelude qualified as Prelude -import Network.IP.Addr qualified as NetworkIp import PostgreSQL.Binary.Decoding qualified as A -- * Result @@ -255,7 +255,7 @@ uuid = Value (Value.decoder (const A.uuid)) -- | -- Decoder of the @INET@ values. {-# INLINEABLE inet #-} -inet :: Value (NetworkIp.NetAddr NetworkIp.IP) +inet :: Value Iproute.IPRange inet = Value (Value.decoder (const A.inet)) -- | diff --git a/library/Hasql/Encoders/All.hs b/library/Hasql/Encoders/All.hs index bcf2699..0a7fd2a 100644 --- a/library/Hasql/Encoders/All.hs +++ b/library/Hasql/Encoders/All.hs @@ -4,13 +4,13 @@ module Hasql.Encoders.All where import Data.Aeson qualified as Aeson import Data.ByteString.Lazy qualified as LazyByteString +import Data.IP qualified as Iproute import Hasql.Encoders.Array qualified as Array import Hasql.Encoders.Params qualified as Params import Hasql.Encoders.Value qualified as Value import Hasql.PostgresTypeInfo qualified as PTI import Hasql.Prelude hiding (bool) import Hasql.Prelude qualified as Prelude -import Network.IP.Addr qualified as NetworkIp import PostgreSQL.Binary.Encoding qualified as A import Text.Builder qualified as C @@ -209,7 +209,7 @@ uuid = Value (Value.unsafePTIWithShow PTI.uuid (const A.uuid)) -- | -- Encoder of @INET@ values. {-# INLINEABLE inet #-} -inet :: Value (NetworkIp.NetAddr NetworkIp.IP) +inet :: Value Iproute.IPRange inet = Value (Value.unsafePTIWithShow PTI.inet (const A.inet)) -- |