CouchDB-0.8.0.2: CouchDB interfaceSource codeContentsIndex
Database.CouchDB.HTTP
Description
Maintains a persistent HTTP connection to a CouchDB database server. CouchDB enjoys closing the connection if there is an error (document not found, etc.) In such cases, CouchMonad will automatically reestablish the connection.
Synopsis
request :: String -> [(String, String)] -> RequestMethod -> [Header] -> String -> CouchMonad Response
data CouchMonad a
runCouchDB :: String -> Int -> CouchMonad a -> IO a
runCouchDB' :: CouchMonad a -> IO a
Documentation
requestSource
:: Stringpath of the request
-> [(String, String)]dictionary of GET parameters
-> RequestMethod
-> [Header]
-> Stringbody of the request
-> CouchMonad Response
Send a request to the database. If the connection is closed, it is reopened and the request is resent. On other errors, we raise an exception.
data CouchMonad a Source
A computation that interacts with a CouchDB database. This monad encapsulates the IO monad, a persistent HTTP connnection to a CouchDB database and enough information to re-open the connection if it is closed.
show/hide Instances
runCouchDBSource
::
=> Stringhostname
-> Intport
-> CouchMonad a
-> IO a
runCouchDB' :: CouchMonad a -> IO aSource
Connects to the CouchDB server at localhost:5984.
Produced by Haddock version 2.3.0