Skip to content

Commit b75d9ac

Browse files
author
Doug Kirk
committed
Add support for fetching results from CouchDB list functions.
1 parent e8e83fc commit b75d9ac

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Clutch is a [Clojure](http://clojure.org) library for [Apache CouchDB](http://co
77
To include Clutch in your project, simply add the following to your `project.clj` dependencies:
88

99
```clojure
10-
[com.ashafa/clutch "0.4.1"]
10+
[com.ashafa/clutch "0.5.0"]
1111
```
1212

1313
Or, if you're using Maven, add this dependency to your `pom.xml`:
@@ -16,7 +16,7 @@ Or, if you're using Maven, add this dependency to your `pom.xml`:
1616
<dependency>
1717
<groupId>com.ashafa</groupId>
1818
<artifactId>clutch</artifactId>
19-
<version>0.4.0</version>
19+
<version>0.5.0</version>
2020
</dependency>
2121
```
2222

project.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
(defproject com.ashafa/clutch "0.4.1"
1+
(defproject com.ashafa/clutch "0.5.0"
22
:description "A Clojure library for Apache CouchDB."
33
:url "https://github.com/clojure-clutch/clutch/"
44
:license {:name "BSD"
55
:url "http://www.opensource.org/licenses/BSD-3-Clause"}
66
:dependencies [[org.clojure/clojure "1.8.0"]
77

8-
[clj-http "3.1.0"]
8+
[clj-http "3.3.0"]
99
[cheshire "5.6.3"]
10-
[commons-codec "1.6"]
10+
[commons-codec "1.10"]
1111
[com.cemerick/url "0.1.1"]
1212

1313
[org.clojure/clojurescript "1.8.40" :optional true

src/com/ashafa/clutch.clj

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
[cheshire.core :as json]
44
[clojure.java.io :as io]
55
[cemerick.url :as url]
6+
[com.ashafa.clutch.http-client :refer :all]
67
clojure.string)
7-
(:use com.ashafa.clutch.http-client)
88
(:import (java.io File FileInputStream BufferedInputStream InputStream ByteArrayOutputStream)
99
(java.net URL))
1010
(:refer-clojure :exclude (conj! assoc! dissoc!)))
@@ -396,6 +396,15 @@
396396
(utils/url db "_design" (name design-document) "_update" (name update-function-name) id)
397397
:data body))
398398

399+
(defdbop get-list
400+
"Get list views associated with a design document.
401+
Also takes an optional map for querying options.
402+
403+
No support for views in design documents other than the one containing the list view."
404+
[db design-document list-key view-key & [query-params-map]]
405+
(let [url (assoc (utils/url db "_design" (name design-document) "_list" (name list-key) (name view-key))
406+
:query query-params-map)]
407+
(couchdb-request :get url)))
399408
;;;; _changes
400409

401410
(defdbop changes

0 commit comments

Comments
 (0)