couchdb-connect
couchdb-server?
couchdb-db
couchdb-database?
couchdb-get
couchdb-put
couchdb-delete
couchdb-view
exn: couchdb?
exn: couchdb: conflict?
exn: couchdb: not-found?
Version: 5.2

CouchDB

Jan Dvorak <[email protected]>

CouchDB client for Racket.

 (require (planet mordae/couchdb/couchdb))

(couchdb-connect [#:host host    
  #:port port    
  #:user user    
  #:password password])  couchdb-server?
  host : string? = "localhost"
  port : exact-nonnegative-integer? = 5984
  user : (or/c string? #f) = #f
  password : (or/c string? #f) = #f
Creates CouchDB server connection information.

In reality, this does not connect anywhere. Each CouchDB request corresponds to one HTTP request.

(couchdb-server? value)  boolean?
  value : any/c
Determines if given value is a CouchDB server information returned by couchdb-connect.

(couchdb-db server name)  couchdb-database?
  server : couchdb-server?
  name : string?
Creates database connection information.

Result of this function is used in all database-local queries. It represents an isolated collection of documents.

(couchdb-database? value)  boolean?
  value : any/c
Determines if given value is a CouchDB database returned by couchdb-db.

(couchdb-get db    
  id    
  [#:rev rev    
  #:open-revs open-revs    
  #:revs-info? revs-info?    
  #:conflicts? conflicts?])  (and/c jsexpr? hash?)
  db : couchdb-database?
  id : string?
  rev : (or/c string? (symbols 'current)) = 'current
  open-revs : 
(or/c (symbols 'all 'current)
      (listof string?))
 = 'current
  revs-info? : boolean? = #f
  conflicts? : boolean? = #f
Retrieves specified document from given CouchDB database.

Consult CouchDB documentation for information on keyword arguments.

(couchdb-put db document)  (and/c jsexpr? hash?)
  db : couchdb-database?
  document : (and/c jsexpr? hash?)
Stores specified document in given CouchDB database.

(couchdb-delete db document)  (and/c jsexpr? hash?)
  db : couchdb-database?
  document : (and/c jsexpr? hash?)
Deletes specified document from the CouchDB database.

(couchdb-view db    
  view    
  [#:include-docs? include-docs?    
  #:key key    
  #:startkey startkey    
  #:startkey-docid startkey-docid    
  #:endkey endkey    
  #:endkey-docid endkey-docid    
  #:limit limit    
  #:stale stale    
  #:descending? descending?    
  #:skip skip    
  #:group? group    
  #:group-level group-level    
  #:reduce? reduce?    
  #:inclusive-end? inclusive-end?    
  #:update-seq? update-seq?])  jsexpr?
  db : couchdb-database?
  view : (list/c string? string?)
  include-docs? : boolean? = #f
  key : (or/c jsexpr? void?) = (void)
  startkey : (or/c jsexpr? void?) = (void)
  startkey-docid : (or/c jsexpr? void?) = (void)
  endkey : (or/c jsexpr? void?) = (void)
  endkey-docid : (or/c jsexpr? void?) = (void)
  limit : (or/c exact-nonnegative-integer? void?) = (void)
  stale : (or/c (symbols 'ok 'update-after) void?) = (void)
  descending? : boolean? = #f
  skip : exact-nonnegative-integer? = 0
  group : boolean? = #f
  group-level : (or/c exact-nonnegative-integer? void?) = (void)
  reduce? : (or/c boolean? void?) = (void)
  inclusive-end? : boolean? = #t
  update-seq? : boolean? = #f
Queries a stored view.

Consult CouchDB documentation for information on keyword arguments.

(exn:couchdb? value)  boolean?
  value : any/c
Generic CouchDB exception.

(exn:couchdb:conflict? value)  boolean?
  value : any/c
Revision conflict exception.
(exn:couchdb:not-found? value)  boolean?
  value : any/c
Document not found exception.