git.iko.soy/typeable/postgresql-simple
on master help sign in
Merge pull request #116 from haskellari/aeson-2.2
41d650dOleg Grenrus
.github/workflows/haskell-ci.yml+8−8
@@ -8,9 +8,9 @@
8#
8#
9# For more information, see https://github.com/haskell-CI/haskell-ci
9# For more information, see https://github.com/haskell-CI/haskell-ci
10#
10#
11−# version: 0.16
11+# version: 0.16.6
12#
12#
13−# REGENDATA ("0.16",["github","cabal.project"])
13+# REGENDATA ("0.16.6",["github","cabal.project"])
14#
14#
15name: Haskell-CI
15name: Haskell-CI
16on:
16on:
@@ -38,19 +38,19 @@ jobs:
38 strategy:
38 strategy:
39 matrix:
39 matrix:
40 include:
40 include:
41− - compiler: ghc-9.6.1
41+ - compiler: ghc-9.6.2
42 compilerKind: ghc
42 compilerKind: ghc
43− compilerVersion: 9.6.1
43+ compilerVersion: 9.6.2
44 setup-method: ghcup
44 setup-method: ghcup
45 allow-failure: false
45 allow-failure: false
46− - compiler: ghc-9.4.4
46+ - compiler: ghc-9.4.5
47 compilerKind: ghc
47 compilerKind: ghc
48− compilerVersion: 9.4.4
48+ compilerVersion: 9.4.5
49 setup-method: ghcup
49 setup-method: ghcup
50 allow-failure: false
50 allow-failure: false
51− - compiler: ghc-9.2.7
51+ - compiler: ghc-9.2.8
52 compilerKind: ghc
52 compilerKind: ghc
53− compilerVersion: 9.2.7
53+ compilerVersion: 9.2.8
54 setup-method: ghcup
54 setup-method: ghcup
55 allow-failure: false
55 allow-failure: false
56 - compiler: ghc-9.0.2
56 - 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+
1### Version 0.6.5 (2022-10-30)
5### Version 0.6.5 (2022-10-30)
2
6
3 * Add `withConnect`
7 * Add `withConnect`
postgresql-simple.cabal+5−6
@@ -1,7 +1,6 @@
1cabal-version: 1.12
1cabal-version: 1.12
2name: postgresql-simple
2name: postgresql-simple
3−version: 0.6.5
3+version: 0.6.5.1
4−x-revision: 1
5synopsis: Mid-Level PostgreSQL client library
4synopsis: Mid-Level PostgreSQL client library
6description:
5description:
7 Mid-Level PostgreSQL client library, forked from mysql-simple.
6 Mid-Level PostgreSQL client library, forked from mysql-simple.
@@ -34,9 +33,9 @@ tested-with:
34 || ==8.8.4
33 || ==8.8.4
35 || ==8.10.7
34 || ==8.10.7
36 || ==9.0.2
35 || ==9.0.2
37− || ==9.2.7
36+ || ==9.2.8
38− || ==9.4.4
37+ || ==9.4.5
39− || ==9.6.1
38+ || ==9.6.2
40
39
41library
40library
42 default-language: Haskell2010
41 default-language: Haskell2010
@@ -92,7 +91,7 @@ library
92
91
93 -- Other dependencies
92 -- Other dependencies
94 build-depends:
93 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
96 , attoparsec >=0.13.2.2 && <0.15
95 , attoparsec >=0.13.2.2 && <0.15
97 , bytestring-builder >=0.10.8.1.0 && <0.11
96 , bytestring-builder >=0.10.8.1.0 && <0.11
98 , case-insensitive >=1.2.0.11 && <1.3
97 , 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, (*>), (
120import Control.Concurrent.MVar (MVar, newMVar)
120import Control.Concurrent.MVar (MVar, newMVar)
121import Control.Exception (Exception)
121import Control.Exception (Exception)
122import qualified Data.Aeson as JSON
122import qualified Data.Aeson as JSON
123−import qualified Data.Aeson.Internal as JSON
124−import qualified Data.Aeson.Parser as JSON (value')
125import Data.Attoparsec.ByteString.Char8 hiding (Result)
123import Data.Attoparsec.ByteString.Char8 hiding (Result)
126import Data.ByteString (ByteString)
124import Data.ByteString (ByteString)
127import qualified Data.ByteString.Char8 as B
125import qualified Data.ByteString.Char8 as B
@@ -156,6 +154,12 @@ import qualified Data.UUID.Types as UUID
156import Data.Scientific (Scientific)
154import Data.Scientific (Scientific)
157import GHC.Real (infinity, notANumber)
155import GHC.Real (infinity, notANumber)
158
156
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+
159-- | Exception thrown if conversion from a SQL value to a Haskell
163-- | Exception thrown if conversion from a SQL value to a Haskell
160-- value fails.
164-- value fails.
161data ResultError = Incompatible { errSQLType :: String
165data ResultError = Incompatible { errSQLType :: String
@@ -574,7 +578,7 @@ instance FromField UUID where
574-- | json, jsonb
578-- | json, jsonb
575instance FromField JSON.Value where
579instance FromField JSON.Value where
576 fromField f mbs = parseBS =<< fromFieldJSONByteString f mbs
580 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
578 Left err -> returnError ConversionFailed f err
582 Left err -> returnError ConversionFailed f err
579 Right val -> pure val
583 Right val -> pure val
580
584