couchdb-conduit-0.10.3: Couch DB client library using http-conduit and aeson

Safe HaskellSafe-Infered

Database.CouchDB.Conduit.Attachment

Description

CouchDB document attachments.

Note about attachment paths: Attachments may have embedded / characters that are sent unescaped to CouchDB. You can use this to provide a subtree of attachments under a document. A DocID must have any / escaped as %2F. So if you have document a/b/c with an attachment d/e/f.txt, you would be able to access it at http://couchdb/db/a%2fb%2fc/d/e/f.txt.

couchdb-conduit automaticaly normalizes attachment paths.

Synopsis

Documentation

couchGetAttachSource

Arguments

:: MonadCouch m 
=> Path

Database

-> Path

Document

-> ByteString

Attachment path

-> m (ResumableSource m ByteString, ByteString) 

Get document attachment and Content-Type.

couchPutAttachSource

Arguments

:: MonadCouch m 
=> Path

Database

-> Path

Document

-> ByteString

Attachment path

-> Revision

Document revision

-> ByteString

Attacment Content-Type

-> RequestBody m

Attachment body

-> m Revision 

Put or update document attachment

couchDeleteAttachSource

Arguments

:: MonadCouch m 
=> Path

Database

-> Path

Document

-> ByteString

Attachment path

-> Revision

Document revision

-> m Revision 

Delete document attachment