couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoit Chesneau <>
Subject erlang rpc call in couchdb
Date Mon, 27 Jul 2009 17:02:31 GMT

During the week-end I've writtent a toolkit to access via HTTP to
couchdb ( but while annonincg
it this morning i ha d the idee to write a simple gen_server to handle
erlang rpc call in CouchDB. It's based on hovercraft from @jchris.
Currently the module lack the possibility of managing attachments and
view streaming. I would be interrested by any feedback about it. Since
erlang rpc call allow us to not convert results in json it could be

So here it is :

patch against latest trunk is attached.

Some examples of current features :

start couchdb like this : ERL_FLAGS="-name mynode" ./utils/run

## Get server/db info :

(enki@enlil.local)14> rpc:call(mynode@enlil.local, couch_rpc,
server_info, []).
(enki@enlil.local)15> rpc:call(mynode@enlil.local, couch_rpc, db_info,

## open/save doc :
(enki@enlil.local)18> rpc:call(mynode@enlil.local, couch_rpc,
save_doc, [<<"testdb">>, {[{<<"testfield">>, <<"somevalue">>}]}]).
(enki@enlil.local)19> rpc:call(mynode@enlil.local, couch_rpc,
open_doc, [<<"testdb">>, <<"7b069de98df234d5b6af4fa5b9125ea1">>]).

Get a view :
(enki@enlil.local)64> rpc:call(mynode@enlil.local, couch_rpc,
query_view, [<<"inditeweb">>, <<"inditeweb">>, <<"alias">>]).

- benoƮt

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message