A CouchDB implementation of the konserve kv-protocol on top of clutch.
Add to your leiningen dependencies:
The whole purpose of konserve is to have a unified associative key-value interface for edn datastructures. Just use the standard interface functions of konserve.
You can also provide a clutch
db object to the new-couch-store
constructor
as an argument. We do not require additional settings beyond the konserve
serialization protocol for the store, so you can still access the store through
clutch directly wherever you need.
(require '[konserve-clutch.core :refer :all]
'[konserve.core :as k)
(def couch-store (<!! (new-clutch-store "my-store")))
(<!! (k/exists? couch-store "john"))
(<!! (k/get-in couch-store ["john"]))
(<!! (k/assoc-in couch-store ["john"] 42))
(<!! (k/update-in couch-store ["john"] inc))
(<!! (k/get-in couch-store ["john"]))
(defrecord Test [a])
(<!! (k/assoc-in couch-store ["peter"] (Test. 5)))
(<!! (k/get-in couch-store ["peter"]))
- binary support
- update to konserve 0.4
- arbitrary key length (hashing)
- use new reduced konserve interface and serializers
- factor out from konserve
Copyright © 2014-2016 Christian Weilbach
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.