git.iko.soy/typeable/postgresql-simple
on master help sign in
Fix Json decoding
46605ebLeon P Smith
src/Database/PostgreSQL/Simple/FromField.hs+6
@@ -460,7 +460,13 @@ instance FromField JSON.Value where
460 else case mbs of
460 else case mbs of
461 Nothing -> returnError UnexpectedNull f ""
461 Nothing -> returnError UnexpectedNull f ""
462 Just bs ->
462 Just bs ->
463+#if MIN_VERSION_aeson(0,6,3)
463 case JSON.eitherDecodeStrict' bs of
464 case JSON.eitherDecodeStrict' bs of
465+#elsif MIN_VERSION_bytestring(0,10,0)
466+ case JSON.eitherDecode' $ LB.fromStrict bs of
467+#else
468+ case JSON.eitherDecode' $ LB.fromChunks [bs] of
469+#endif
464 Left err -> returnError ConversionFailed f err
470 Left err -> returnError ConversionFailed f err
465 Right val -> pure val
471 Right val -> pure val
466
472