#lang scribble/manual @require[(for-label racket net/url)] @require[(for-label (planet dherman/json:3:0))] @require[(for-label (planet mordae/couchdb/couchdb))] @title{CouchDB} @author{@(author+email "Jan Dvorak" "mordae@anilinux.org")} CouchDB client for Racket. @defmodule[(planet mordae/couchdb/couchdb)] @defproc[(couchdb-connect (#:host host string? "localhost") (#:port port exact-nonnegative-integer? 5984) (#:user user (or/c string? #f) #f) (#:password password (or/c string? #f) #f)) couchdb-server?]{ Creates CouchDB server connection information. In reality, this does not connect anywhere. Each CouchDB request corresponds to one HTTP request. } @defproc[(couchdb-server? (value any/c)) boolean?]{ Determines if given value is a CouchDB server information returned by @racket[couchdb-connect]. } @defproc[(couchdb-db (server couchdb-server?) (name string?)) couchdb-database?]{ Creates database connection information. Result of this function is used in all database-local queries. It represents an isolated collection of documents. } @defproc[(couchdb-database? (value any/c)) boolean?]{ Determines if given value is a CouchDB database returned by @racket[couchdb-db]. } @defproc[(couchdb-get (db couchdb-database?) (id string?) (#:rev rev (or/c string? (symbols 'current)) 'current) (#:open-revs open-revs (or/c (symbols 'all 'current) (listof string?)) 'current) (#:revs-info? revs-info? boolean? #f) (#:conflicts? conflicts? boolean? #f)) (and/c jsexpr? hash?)]{ Retrieves specified document from given CouchDB database. Consult @link["http://wiki.apache.org/couchdb/HTTP_Document_API"]{CouchDB documentation} for information on keyword arguments. } @defproc[(couchdb-put (db couchdb-database?) (document (and/c jsexpr? hash?))) (and/c jsexpr? hash?)]{ Stores specified document in given CouchDB database. } @defproc[(couchdb-delete (db couchdb-database?) (document (and/c jsexpr? hash?))) (and/c jsexpr? hash?)]{ Deletes specified document from the CouchDB database. } @defproc[(couchdb-view (db couchdb-database?) (view (list/c string? string?)) (#:include-docs? include-docs? boolean? #f) (#:key key (or/c jsexpr? void?) (void)) (#:startkey startkey (or/c jsexpr? void?) (void)) (#:startkey-docid startkey-docid (or/c jsexpr? void?) (void)) (#:endkey endkey (or/c jsexpr? void?) (void)) (#:endkey-docid endkey-docid (or/c jsexpr? void?) (void)) (#:limit limit (or/c exact-nonnegative-integer? void?) (void)) (#:stale stale (or/c (symbols 'ok 'update-after) void?) (void)) (#:descending? descending? boolean? #f) (#:skip skip exact-nonnegative-integer? 0) (#:group? group boolean? #f) (#:group-level group-level (or/c exact-nonnegative-integer? void?) (void)) (#:reduce? reduce? (or/c boolean? void?) (void)) (#:inclusive-end? inclusive-end? boolean? #t) (#:update-seq? update-seq? boolean? #f)) jsexpr?]{ Queries a stored view. Consult @link["http://wiki.apache.org/couchdb/HTTP_view_API"]{CouchDB documentation} for information on keyword arguments. } @defproc[(exn:couchdb? (value any/c)) boolean?]{ Generic CouchDB exception. } @defproc[(exn:couchdb:conflict? (value any/c)) boolean?]{ Revision conflict exception. } @defproc[(exn:couchdb:not-found? (value any/c)) boolean?]{ Document not found exception. } @; vim:set ft=scribble sw=2 ts=2 et: