CouchDB 1.2.2 → 1.2.3
raw patch · 4 files changed
+25/−12 lines, 4 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Database.CouchDB: bulkUpdateDocs :: (JSON a) => DB -> [a] -> CouchMonad (Maybe [Either String (Doc, Rev)])
+ Database.CouchDB: bulkUpdateDocs :: JSON a => DB -> [a] -> CouchMonad (Maybe [Either String (Doc, Rev)])
- Database.CouchDB: createCouchConn :: String -> Int -> IO (CouchConn)
+ Database.CouchDB: createCouchConn :: String -> Int -> IO CouchConn
- Database.CouchDB: createCouchConnFromURI :: URI -> IO (CouchConn)
+ Database.CouchDB: createCouchConnFromURI :: URI -> IO CouchConn
- Database.CouchDB: getAndUpdateDoc :: (JSON a) => DB -> Doc -> (a -> IO a) -> CouchMonad (Maybe Rev)
+ Database.CouchDB: getAndUpdateDoc :: JSON a => DB -> Doc -> (a -> IO a) -> CouchMonad (Maybe Rev)
- Database.CouchDB: getDoc :: (JSON a) => DB -> Doc -> CouchMonad (Maybe (Doc, Rev, a))
+ Database.CouchDB: getDoc :: JSON a => DB -> Doc -> CouchMonad (Maybe (Doc, Rev, a))
- Database.CouchDB: newDoc :: (JSON a) => DB -> a -> CouchMonad (Doc, Rev)
+ Database.CouchDB: newDoc :: JSON a => DB -> a -> CouchMonad (Doc, Rev)
- Database.CouchDB: newNamedDoc :: (JSON a) => DB -> Doc -> a -> CouchMonad (Either String Rev)
+ Database.CouchDB: newNamedDoc :: JSON a => DB -> Doc -> a -> CouchMonad (Either String Rev)
- Database.CouchDB: queryView :: (JSON a) => DB -> Doc -> Doc -> [(String, JSValue)] -> CouchMonad [(Doc, a)]
+ Database.CouchDB: queryView :: JSON a => DB -> Doc -> Doc -> [(String, JSValue)] -> CouchMonad [(Doc, a)]
- Database.CouchDB: updateDoc :: (JSON a) => DB -> (Doc, Rev) -> a -> CouchMonad (Maybe (Doc, Rev))
+ Database.CouchDB: updateDoc :: JSON a => DB -> (Doc, Rev) -> a -> CouchMonad (Maybe (Doc, Rev))
- Database.CouchDB.JSON: jsonInt :: (Integral n) => JSValue -> Result n
+ Database.CouchDB.JSON: jsonInt :: Integral n => JSValue -> Result n
Files
- CHANGES +4/−0
- CouchDB.cabal +7/−6
- src/Database/CouchDB/HTTP.hs +4/−0
- src/Tests.hs +10/−6
CHANGES view
@@ -1,3 +1,7 @@+1.2.3 (2020/7/3)++* GHC 8.8 and 8.10 support (Ben Franksen)+ 1.2.2 (2015/5/6) * Change of maintainer
CouchDB.cabal view
@@ -1,6 +1,6 @@ Name: CouchDB-Version: 1.2.2-Cabal-Version: >= 1.8+Version: 1.2.3+Cabal-Version: >= 1.10 Copyright: Copyright (c) 2008-2012. License: BSD3 License-file: LICENSE@@ -26,30 +26,31 @@ Test-Suite test-couchdb Hs-Source-Dirs: src+ default-language: Haskell2010 Type: exitcode-stdio-1.0 Main-Is: Tests.hs Build-Depends:- base >= 4 && < 5, mtl, containers, HTTP>=4000.0.4, json>=0.4.3, utf8-string >= 0.3.6 && <= 1.1, HUnit, bytestring+ base, mtl, containers, HTTP>=4000.0.4, json>=0.4.3, utf8-string >= 0.3.6 && <= 1.1, HUnit, bytestring if flag(network-uri) build-depends: network >= 2.6, network-uri >= 2.6 else build-depends: network < 2.6, network-uri < 2.6- Extensions:+ default-extensions: FlexibleInstances ghc-options: -fwarn-incomplete-patterns Library Hs-Source-Dirs: src+ default-language: Haskell2010 Build-Depends:- base >= 4 && < 5, mtl, containers, network, network-uri, HTTP>=4000.0.4, json>=0.4.3, utf8-string >= 0.3.6 && <= 1.1, bytestring+ base >= 4 && < 4.15, mtl, containers, network, network-uri, HTTP>=4000.0.4, json>=0.4.3, utf8-string >= 0.3.6 && <= 1.1, bytestring if flag(network-uri) build-depends: network >= 2.6, network-uri >= 2.6 else build-depends: network < 2.6, network-uri < 2.6 ghc-options: -fwarn-incomplete-patterns- Extensions: Exposed-Modules: Database.CouchDB Database.CouchDB.JSON Other-Modules:
src/Database/CouchDB/HTTP.hs view
@@ -2,6 +2,7 @@ -- CouchDB enjoys closing the connection if there is an error (document -- not found, etc.) In such cases, 'CouchMonad' will automatically -- reestablish the connection.+{-# LANGUAGE CPP #-} module Database.CouchDB.HTTP ( request , RequestMethod (..)@@ -64,6 +65,9 @@ let (CouchMonad m') = k a m' conn' +#if MIN_VERSION_base(4,13,0)+instance MonadFail CouchMonad where+#endif fail msg = CouchMonad $ \conn -> do fail $ "internal error: " ++ msg
src/Tests.hs view
@@ -93,15 +93,19 @@ testNamedDocs = testWithDB "add named documents" $ \mydb -> do newNamedDoc mydb (doc "arjun") (people !! 0) newNamedDoc mydb (doc "alex") (people !! 1)- Just (_,_,v1) <- getDoc mydb (doc "arjun")- Just (_,_,v2) <- getDoc mydb (doc "alex") - return $ (v1 == people !! 0) && (v2 == people !! 1)+ jv1 <- getDoc mydb (doc "arjun")+ jv2 <- getDoc mydb (doc "alex")+ case (jv1,jv2) of+ (Just (_,_,v1), Just (_,_,v2)) ->+ return $ (v1 == people !! 0) && (v2 == people !! 1)+ _ -> error "impossible" testUTF8 = testWithDB "test UTF8 characters" $ \db -> do newNamedDoc db (doc "d0") (Age "äöüß" 900)- Just (_, _, d) <- getDoc db (doc "d0")- return (ageName d == "äöüß")-+ jd <- getDoc db (doc "d0")+ case jd of+ Just (_, _, d) -> return (ageName d == "äöüß")+ _ -> error "impossible" allTests = TestList [ testCreate, testNamedDocs, testUTF8 ]