hasql 0.19.6 → 0.19.7
raw patch · 3 files changed
+47/−13 lines, 3 filesdep ~postgresql-binaryPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: postgresql-binary
API changes (from Hackage documentation)
+ Hasql.Decoders: jsonBytes :: (ByteString -> Either Text a) -> Value a
+ Hasql.Decoders: jsonbBytes :: (ByteString -> Either Text a) -> Value a
+ Hasql.Encoders: jsonBytes :: Value ByteString
+ Hasql.Encoders: jsonbBytes :: Value ByteString
Files
- hasql.cabal +5/−5
- library/Hasql/Decoders.hs +22/−4
- library/Hasql/Encoders.hs +20/−4
hasql.cabal view
@@ -1,7 +1,7 @@ name: hasql version:- 0.19.6+ 0.19.7 category: Hasql, Database, PostgreSQL synopsis:@@ -42,7 +42,7 @@ library ghc-options: default-extensions:- Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 other-modules:@@ -74,7 +74,7 @@ -- parsing: attoparsec >= 0.10 && < 0.14, -- database:- postgresql-binary >= 0.7.7 && < 0.8,+ postgresql-binary >= 0.8 && < 0.9, postgresql-libpq == 0.9.*, -- data: dlist >= 0.7 && < 0.8,@@ -116,7 +116,7 @@ Main.Queries Main.Prelude default-extensions:- Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 build-depends:@@ -169,7 +169,7 @@ -fprof-auto "-with-rtsopts=-N -p -s -h -i0.1" default-extensions:- Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, ImpredicativeTypes, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples+ Arrows, BangPatterns, ConstraintKinds, DataKinds, DefaultSignatures, DeriveDataTypeable, DeriveFoldable, DeriveFunctor, DeriveGeneric, DeriveTraversable, EmptyDataDecls, FlexibleContexts, FlexibleInstances, FunctionalDependencies, GADTs, GeneralizedNewtypeDeriving, LambdaCase, LiberalTypeSynonyms, MagicHash, MultiParamTypeClasses, MultiWayIf, NoImplicitPrelude, NoMonomorphismRestriction, OverloadedStrings, PatternGuards, ParallelListComp, QuasiQuotes, RankNTypes, RecordWildCards, ScopedTypeVariables, StandaloneDeriving, TemplateHaskell, TupleSections, TypeFamilies, TypeOperators, UnboxedTuples default-language: Haskell2010 build-depends:
library/Hasql/Decoders.hs view
@@ -38,7 +38,9 @@ interval, uuid, json,+ jsonBytes, jsonb,+ jsonbBytes, array, composite, hstore,@@ -414,20 +416,36 @@ Value (Value.decoder (const Decoder.uuid)) -- |--- Decoder of the @JSON@ values.+-- Decoder of the @JSON@ values into a JSON AST. -- {-# INLINABLE json #-} json :: Value Aeson.Value json =- Value (Value.decoder (const Decoder.json))+ Value (Value.decoder (const Decoder.json_ast)) -- |--- Decoder of the @JSONB@ values.+-- Decoder of the @JSON@ values into a raw JSON 'ByteString'. -- +{-# INLINABLE jsonBytes #-}+jsonBytes :: (ByteString -> Either Text a) -> Value a+jsonBytes fn =+ Value (Value.decoder (const (Decoder.json_bytes fn)))++-- |+-- Decoder of the @JSONB@ values into a JSON AST.+-- {-# INLINABLE jsonb #-} jsonb :: Value Aeson.Value jsonb =- Value (Value.decoder (const Decoder.jsonb))+ Value (Value.decoder (const Decoder.jsonb_ast))++-- |+-- Decoder of the @JSONB@ values into a raw JSON 'ByteString'.+-- +{-# INLINABLE jsonbBytes #-}+jsonbBytes :: (ByteString -> Either Text a) -> Value a+jsonbBytes fn =+ Value (Value.decoder (const (Decoder.jsonb_bytes fn))) -- | -- Lifts a custom value decoder function to a 'Value' decoder.
library/Hasql/Encoders.hs view
@@ -27,7 +27,9 @@ interval, uuid, json,+ jsonBytes, jsonb,+ jsonbBytes, array, enum, unknown,@@ -300,18 +302,32 @@ Value (Value.unsafePTI PTI.uuid (const Encoder.uuid)) -- |--- Encoder of @JSON@ values.+-- Encoder of @JSON@ values from JSON AST. {-# INLINABLE json #-} json :: Value Aeson.Value json =- Value (Value.unsafePTI PTI.json (const Encoder.json))+ Value (Value.unsafePTI PTI.json (const Encoder.json_ast)) -- |--- Encoder of @JSONB@ values.+-- Encoder of @JSON@ values from raw JSON.+{-# INLINABLE jsonBytes #-}+jsonBytes :: Value ByteString+jsonBytes =+ Value (Value.unsafePTI PTI.json (const Encoder.json_bytes))++-- |+-- Encoder of @JSONB@ values from JSON AST. {-# INLINABLE jsonb #-} jsonb :: Value Aeson.Value jsonb =- Value (Value.unsafePTI PTI.jsonb (const Encoder.jsonb))+ Value (Value.unsafePTI PTI.jsonb (const Encoder.jsonb_ast))++-- |+-- Encoder of @JSONB@ values from raw JSON.+{-# INLINABLE jsonbBytes #-}+jsonbBytes :: Value ByteString+jsonbBytes =+ Value (Value.unsafePTI PTI.jsonb (const Encoder.jsonb_bytes)) -- | -- Unlifts the 'Array' encoder to the plain 'Value' encoder.