git.iko.soy/typeable/postgresql-simple
on master help sign in
Support aeson-2.2
commitfd20fc65c0f2b279051787070810ed69a312528c authorOleg Grenrus <oleg.grenrus@iki.fi> dateSun 9 Jul 2023, 17:32 (3 years ago) parent34b609d
4 files changed+24−17
.github/workflows/haskell-ci.yml+8−8 CHANGES.md+4 postgresql-simple.cabal+5−6 src/Database/PostgreSQL/Simple/FromField.hs+7−3
.github/workflows/haskell-ci.yml+8−8
@@ -8,9 +8,9 @@
88#
99# For more information, see https://github.com/haskell-CI/haskell-ci
1010#
11−# version: 0.16
11+# version: 0.16.6
1212#
13−# REGENDATA ("0.16",["github","cabal.project"])
13+# REGENDATA ("0.16.6",["github","cabal.project"])
1414#
1515name: Haskell-CI
1616on:
@@ -38,19 +38,19 @@ jobs:
3838 strategy:
3939 matrix:
4040 include:
41− - compiler: ghc-9.6.1
41+ - compiler: ghc-9.6.2
4242 compilerKind: ghc
43− compilerVersion: 9.6.1
43+ compilerVersion: 9.6.2
4444 setup-method: ghcup
4545 allow-failure: false
46− - compiler: ghc-9.4.4
46+ - compiler: ghc-9.4.5
4747 compilerKind: ghc
48− compilerVersion: 9.4.4
48+ compilerVersion: 9.4.5
4949 setup-method: ghcup
5050 allow-failure: false
51− - compiler: ghc-9.2.7
51+ - compiler: ghc-9.2.8
5252 compilerKind: ghc
53− compilerVersion: 9.2.7
53+ compilerVersion: 9.2.8
5454 setup-method: ghcup
5555 allow-failure: false
5656 - compiler: ghc-9.0.2
CHANGES.md+4
@@ -1,3 +1,7 @@
1+### Version 0.6.5.1 (2023-07-09)
2+
3+ * Support `aeson-2.2.0.0`
4+
15### Version 0.6.5 (2022-10-30)
26
37 * Add `withConnect`
postgresql-simple.cabal+5−6
@@ -1,7 +1,6 @@
11cabal-version: 1.12
22name: postgresql-simple
3−version: 0.6.5
4−x-revision: 1
3+version: 0.6.5.1
54synopsis: Mid-Level PostgreSQL client library
65description:
76 Mid-Level PostgreSQL client library, forked from mysql-simple.
@@ -34,9 +33,9 @@ tested-with:
3433 || ==8.8.4
3534 || ==8.10.7
3635 || ==9.0.2
37− || ==9.2.7
38− || ==9.4.4
39− || ==9.6.1
36+ || ==9.2.8
37+ || ==9.4.5
38+ || ==9.6.2
4039
4140library
4241 default-language: Haskell2010
@@ -92,7 +91,7 @@ library
9291
9392 -- Other dependencies
9493 build-depends:
95− aeson >=1.4.1.0 && <1.6 || >=2.0.0.0 && <2.2
94+ aeson >=1.4.1.0 && <1.6 || >=2.0.0.0 && <2.3
9695 , attoparsec >=0.13.2.2 && <0.15
9796 , bytestring-builder >=0.10.8.1.0 && <0.11
9897 , case-insensitive >=1.2.0.11 && <1.3
src/Database/PostgreSQL/Simple/FromField.hs+7−3
@@ -120,8 +120,6 @@ import Control.Applicative ( Const(Const), (<|>), (<$>), pure, (*>), (
120120import Control.Concurrent.MVar (MVar, newMVar)
121121import Control.Exception (Exception)
122122import qualified Data.Aeson as JSON
123−import qualified Data.Aeson.Internal as JSON
124−import qualified Data.Aeson.Parser as JSON (value')
125123import Data.Attoparsec.ByteString.Char8 hiding (Result)
126124import Data.ByteString (ByteString)
127125import qualified Data.ByteString.Char8 as B
@@ -156,6 +154,12 @@ import qualified Data.UUID.Types as UUID
156154import Data.Scientific (Scientific)
157155import GHC.Real (infinity, notANumber)
158156
157+#if MIN_VERSION_aeson(2,1,2)
158+import qualified Data.Aeson.Types as JSON
159+#else
160+import qualified Data.Aeson.Internal as JSON
161+#endif
162+
159163-- | Exception thrown if conversion from a SQL value to a Haskell
160164-- value fails.
161165data ResultError = Incompatible { errSQLType :: String
@@ -574,7 +578,7 @@ instance FromField UUID where
574578-- | json, jsonb
575579instance FromField JSON.Value where
576580 fromField f mbs = parseBS =<< fromFieldJSONByteString f mbs
577− where parseBS bs = case parseOnly (JSON.value' <* endOfInput) bs of
581+ where parseBS bs = case JSON.eitherDecodeStrict' bs of
578582 Left err -> returnError ConversionFailed f err
579583 Right val -> pure val
580584