erlang couchdb client based on ibrowse
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

erl-couch : An Erlang based CouchDB client


erl-couch is a CouchDB client that is now written as a gen_server (suggestion from Paul Davis). It starts and stops either ibrowse or inets, as needed, so it run pretty much by itself. It requires the couchdb bundled mochijson2 and ibrowse.

It's started by calling:


where Option is a list, .eg.

erl_couch:start([{host, ""}, {port, 5984},{ibrowse, true}]).

calling erl_couch:stop() takes care of stopping ibrowse


erl-couch is a CouchDB client that picks up from erlcouch (which has been discontinued).

erl-couch spawns a process for each host and for each database. For the stress tests we're cobbling together for couchdb this hopefully will allow us to simulate multiple clients from the same machine.


This new version adds support for ibrowse, as well as the default inets. Note that inets or ibrowse must be started first. One enhancement over erlcouch was to remove many of the options that were passed around with each call as they were used solely to construct urls, many of which stay the same form call to call (.eg. the host). It's also been upgraded to use mochijson2 which is embedded in CouchDB.

Each Host and Db is a separate pid, so multiple hosts and databases can be opened concurrently. The Args paramaters are constructed. Each api call returns either {ok, Json} or {error, Json, Raw}. The API is very simple, all the munging of JSON docs has to be done outside, there are no calls that take parameter and construct the JSON.

I'm not sure how useful an api at this low level is for applications, the two scenarios I have in mind are 1. testing and 2. perhaps a server side external.