Module

Perspectives.Couchdb.Databases

#ID

type ID = String

#qualifyRequest

qualifyRequest :: forall f a. Request a -> MonadCouchdb f (Request a)

Does not modify the request when:

  • the sessionCookie AVar is empty;
  • the value of the sessionCookie AVar is "Browser" (we don't do Authentication Cookies on the browser, as it handles them itself.) Otherwise, adds a Cookie header containing the cached cookie. This is a synchronous function.

#defaultPerspectRequest

#authenticate

#requestAuthentication

requestAuthentication :: forall f. MonadCouchdb f Unit

To be called when the cookie is no longer valid.

#requestAuthentication'

requestAuthentication' :: forall f. User -> Password -> MonadCouchdb f Unit

To be called if there is no cookie at all.

#ensureAuthentication

#logout

logout :: forall f. MonadCouchdb f Unit

A logout is purely client side, as Couchdb keeps no session state. (see: http://127.0.0.1:5984/_utils/docs/api/server/authn.html#api-auth-cookie)

#createDatabase

#deleteDatabase

#createUser

createUser :: forall f. User -> Password -> Array Role -> MonadCouchdb f Unit

Create a non-admin user.

#Role

type Role = String

#setSecurityDocument

setSecurityDocument :: forall f. DatabaseName -> Json -> MonadCouchdb f Unit

Set the security document in the database.

#setDesignDocument

setDesignDocument :: forall f. DatabaseName -> DocumentName -> Json -> MonadCouchdb f Unit

Set the design document in the database.

#DocumentName

#allDbs

allDbs :: forall f. MonadCouchdb f (Array String)

#documentExists

#retrieveDocumentVersion

#addAttachment

#version

version :: forall m. MonadError Error m => Array ResponseHeader -> m (Maybe String)

Read the version from the headers.

Modules