[clouchdb-cvs] CVS clouchdb/src

peddy peddy at common-lisp.net
Sat Jun 27 13:05:23 UTC 2009


Update of /project/clouchdb/cvsroot/clouchdb/src
In directory cl-net:/tmp/cvs-serv14227

Modified Files:
	clouchdb.lisp 
Log Message:
Updated view parameters to reflect CouchDb changes


--- /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp	2009/06/27 00:51:42	1.34
+++ /project/clouchdb/cvsroot/clouchdb/src/clouchdb.lisp	2009/06/27 13:05:23	1.35
@@ -25,8 +25,7 @@
 (in-package :clouchdb)
 
 (defvar *host* "localhost" "CouchDb server host name")
-(defvar *port* "5984"
-  "As of version 7.2, the IANA assigned CouchDb port (was 8888)")
+(defvar *port* "5984" "The IANA assigned CouchDb port")
 (defvar *db-name* "default" "Default database name")
 (defvar *protocol* "http" "http or https")
 (defvar *document-update-fn* nil)
@@ -71,10 +70,16 @@
     (:start-key . ((:name . "startkey") (:fn . document-to-json)))
     (:start-key-docid . ((:name . "startkey_docid") (:fn . document-to-json)))
     (:end-key . ((:name . "endkey") (:fn . document-to-json)))
+    (:end-key-docid . ((:name . "endkey_docsid") (:fn . document-to-json)))
     (:limit . ((:name . "limit") (:fn . value-as-string)))
-    (:update . ((:name . "update") (:fn . false-if-false)))
+    (:stale . ((:name . "stale") (:fn . value-as-string)))
     (:descending . ((:name . "descending") (:fn . true-if-true)))
-    (:skip . ((:name . "skip") (:fn . value-as-integer))))
+    (:skip . ((:name . "skip") (:fn . document-to-json)))
+    (:group . ((:name . "group") (:fn . true-if-true)))
+    (:group-level . ((:name . "group_level") (:fn . document-to-json)))
+    (:reduce . ((:name . "reduce") (:fn . false-if-false)))
+    (:include-docs . ((:name . "include_docs") (:fn . true-if-true)))
+    (:update . ((:name . "update") (:fn . false-if-false))))
   "Definitions for how invoke-view keyword parameters are translated
   into CouchDb parameters")
 
@@ -669,11 +674,18 @@
                   :method :copy
                   :additional-headers `(("Destination" . ,id))))))
                 
-(defun all-docs-by-seq ()
+(defun all-docs-by-seq (&rest options &key key start-key
+                        start-key-docid end-key end-key-docid limit
+                        stale descending skip group group-level reduce
+                        include-docs)
   "See all documents that were updated and deleted, in the order these
 actions are done."
+  (declare (ignore key start-key start-key-docid end-key end-key-docid
+                   limit stale descending skip group group-level
+                   reduce include-docs))
   (ensure-db ()
-    (db-request (cat (url-encode *db-name*) "/_all_docs_by_seq"))))
+    (db-request (cat (url-encode *db-name*) "/_all_docs_by_seq")
+                :parameters (transform-params options *view-options*))))
 
 (defun as-deleted-document (doc)
   "Return specified document in a special document format used by
@@ -732,11 +744,14 @@
 ;; Views API
 ;;
 
-(defun ad-hoc-view (view &rest options &key key start-key start-key-docid
-                    end-key count update descending skip)
+(defun ad-hoc-view (view &rest options &key key start-key
+                    start-key-docid end-key end-key-docid limit stale
+                    descending skip group group-level reduce
+                    include-docs)
   "Execute query using an ad-hoc view."
-  (declare (ignore key start-key start-key-docid end-key count
-                   update descending skip))
+  (declare (ignore key start-key start-key-docid end-key end-key-docid
+                   limit stale descending skip group group-level
+                   reduce include-docs))
   (ensure-db ()
     (db-request (cat (url-encode *db-name*) "/_temp_view")
 		:method :post
@@ -804,8 +819,10 @@
     (delete-document :id (cat "_design/" (url-encode id)) 
                      :revision revision :if-missing if-missing)))
 
-(defun invoke-view (id view &rest options &key key start-key start-key-docid
-                    end-key limit update descending skip)
+(defun invoke-view (id view &rest options &key key start-key
+                    start-key-docid end-key end-key-docid limit stale
+                    descending skip group group-level reduce
+                    include-docs)
   "Invoke a view by specifiying the document ID that contains the view
 and the name of the contained view. The key parameter specifies an
 optional value to match against the view's mapped field. The start-key
@@ -814,8 +831,9 @@
 returns results in reverse order. If update is t, does not refresh
 view for query, use for higher performance but possible data
 inconsistency."
-  (declare (ignore key start-key start-key-docid end-key
-                   limit update descending skip))
+  (declare (ignore key start-key start-key-docid end-key end-key-docid
+                   limit stale descending skip group group-level
+                   reduce include-docs))
   (ensure-db ()
     (db-request (cat (url-encode *db-name*) "/_design/" 
                      (url-encode id) "/_view/" (url-encode view))





More information about the clouchdb-cvs mailing list