packages feed

postgresql-binary 0.12.4.4 → 0.12.5

raw patch · 7 files changed

+59/−39 lines, 7 filesdep −conversiondep −conversion-bytestringdep −conversion-textdep ~aeson

Dependencies removed: conversion, conversion-bytestring, conversion-text, json-ast

Dependency ranges changed: aeson

Files

library/PostgreSQL/Binary/Encoding.hs view
@@ -47,8 +47,10 @@   interval_float,   -- ** JSON   json_bytes,+  json_bytes_lazy,   json_ast,   jsonb_bytes,+  jsonb_bytes_lazy,   jsonb_ast,    -- * Array@@ -296,6 +298,11 @@ json_bytes =   B.json_bytes +{-# INLINE json_bytes_lazy #-}+json_bytes_lazy :: N.ByteString -> Encoding+json_bytes_lazy =+  B.json_bytes_lazy+ {-# INLINE json_ast #-} json_ast :: R.Value -> Encoding json_ast =@@ -305,6 +312,11 @@ jsonb_bytes :: ByteString -> Encoding jsonb_bytes =   B.jsonb_bytes++{-# INLINE jsonb_bytes_lazy #-}+jsonb_bytes_lazy :: N.ByteString -> Encoding+jsonb_bytes_lazy =+  B.jsonb_bytes_lazy  {-# INLINE jsonb_ast #-} jsonb_ast :: R.Value -> Encoding
library/PostgreSQL/Binary/Encoding/Builders.hs view
@@ -342,6 +342,11 @@ json_bytes =   bytes +{-# INLINE json_bytes_lazy #-}+json_bytes_lazy :: N.ByteString -> Builder+json_bytes_lazy =+  lazyBytes+ {-# INLINE json_ast #-} json_ast :: R.Value -> Builder json_ast =@@ -351,6 +356,11 @@ jsonb_bytes :: ByteString -> Builder jsonb_bytes =   mappend "\1" . bytes++{-# INLINE jsonb_bytes_lazy #-}+jsonb_bytes_lazy :: N.ByteString -> Builder+jsonb_bytes_lazy =+  mappend "\1" . lazyBytes  {-# INLINE jsonb_ast #-} jsonb_ast :: R.Value -> Builder
postgresql-binary.cabal view
@@ -1,7 +1,7 @@ name:   postgresql-binary version:-  0.12.4.4+  0.12.5 synopsis:   Encoders and decoders for the PostgreSQL's binary format description:@@ -101,11 +101,7 @@   default-language:     Haskell2010   build-depends:-    aeson,-    conversion ==1.*,-    conversion-bytestring ==1.*,-    conversion-text ==1.*,-    json-ast ==0.3.*,+    aeson >=2 && <3,     network-ip >=0.2 && <1,     postgresql-binary,     postgresql-libpq ==0.9.*,
tasty/Main.hs view
@@ -17,6 +17,7 @@ import qualified Main.PTI as PTI import qualified Main.TextEncoder as TextEncoder import qualified Database.PostgreSQL.LibPQ as LibPQ+import qualified Data.Text.Lazy as TextLazy import Main.Apx (Apx(..))  @@ -138,7 +139,7 @@             ,             primitiveRoundtrip "text_strict" Gens.text PTI.text A.text_strict B.text_strict             ,-            primitiveRoundtrip "text_lazy" (fmap convert Gens.text) PTI.text A.text_lazy B.text_lazy+            primitiveRoundtrip "text_lazy" (fmap TextLazy.fromStrict Gens.text) PTI.text A.text_lazy B.text_lazy             ,             primitiveRoundtrip "bytea_strict" Gens.auto PTI.bytea A.bytea_strict B.bytea_strict             ,
tasty/Main/Gens.hs view
@@ -3,7 +3,6 @@ import Main.Prelude hiding (assert, isRight, isLeft, choose) import Test.QuickCheck hiding (vector) import Test.QuickCheck.Instances-import JSONAST import qualified Main.PTI as PTI import qualified Data.Scientific as Scientific import qualified Data.UUID as UUID@@ -12,6 +11,8 @@ import qualified PostgreSQL.Binary.Encoding as Encoder import qualified Data.Text as Text import qualified Data.Aeson as Aeson+import qualified Data.Aeson.KeyMap as AesonKeyMap+import qualified Data.Aeson.Key as AesonKey import qualified Network.IP.Addr as IPAddr  @@ -22,8 +23,19 @@ auto =   arbitrary -json :: Gen JSON-json =+vector :: Gen a -> Gen (Vector a)+vector element =+  join $ Vector.replicateM <$> arbitrary <*> pure element++hashMap :: (Eq a, Hashable a) => Gen a -> Gen b -> Gen (HashMap a b)+hashMap key value =+  fmap HashMap.fromList $ join $ replicateM <$> arbitrary <*> pure row+  where+    row =+      (,) <$> key <*> value++aeson :: Gen Aeson.Value+aeson =   byDepth 0   where     byDepth depth =@@ -40,34 +52,27 @@             freq =               maxFreq - depth         maxFreq =-          6+          4         null =-          pure JSON_Null+          pure Aeson.Null         bool =-          fmap JSON_Bool arbitrary+          fmap Aeson.Bool arbitrary         number =-          fmap JSON_Number arbitrary+          fmap Aeson.Number arbitrary         string =-          fmap JSON_String text+          fmap Aeson.String text         array =-          fmap JSON_Array (vector (byDepth (succ depth)))+          fmap Aeson.Array (vector (byDepth (succ depth)))         object =-          fmap JSON_Object (hashMap text (byDepth (succ depth)))--vector :: Gen a -> Gen (Vector a)-vector element =-  join $ Vector.replicateM <$> arbitrary <*> pure element--hashMap :: (Eq a, Hashable a) => Gen a -> Gen b -> Gen (HashMap a b)-hashMap key value =-  fmap HashMap.fromList $ join $ replicateM <$> arbitrary <*> pure row-  where-    row =-      (,) <$> key <*> value--aeson :: Gen Aeson.Value-aeson =-  fmap unsafeCoerce json+          Aeson.Object . AesonKeyMap.fromList <$> listOf pair+          where+            pair =+              (,) <$> key <*> value+              where+                key =+                  AesonKey.fromText <$> text+                value =+                  byDepth (succ depth)  postgresInt :: (Bounded a, Ord a, Integral a, Arbitrary a) => Gen a postgresInt =
tasty/Main/IO.hs view
@@ -15,6 +15,8 @@ import qualified PostgreSQL.Binary.Decoding as A import qualified PostgreSQL.Binary.Encoding as B import qualified Database.PostgreSQL.LibPQ as LibPQ+import qualified Data.ByteString.Builder as ByteStringBuilder+import qualified Data.ByteString.Lazy as ByteStringLazy   textRoundtrip :: LibPQ.Oid -> TextEncoder.Encoder a -> (Bool -> A.Value a) -> a -> IO (Either Text a)@@ -29,7 +31,7 @@       [ Just ( oid , bytes , LibPQ.Text ) ]       where         bytes =-          (convert . encoder) value+          (ByteStringLazy.toStrict . ByteStringBuilder.toLazyByteString . encoder) value  roundtrip :: LibPQ.Oid -> (Bool -> a -> B.Encoding) -> (Bool -> A.Value b) -> a -> IO (Either Text b) roundtrip oid encoder decoder value =
tasty/Main/Prelude.hs view
@@ -13,12 +13,6 @@ ------------------------- import Prelude as Exports hiding (assert, Data, fail, check) --- conversion---------------------------import Conversion as Exports-import Conversion.Text ()-import Conversion.ByteString ()- -- custom ------------------------- import qualified Data.ByteString.Lazy