<div dir="ltr">On Fri, Aug 9, 2013 at 12:57 PM, Benoit Chesneau <span dir="ltr"><<a href="mailto:bchesneau@gmail.com" target="_blank">bchesneau@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">not sure if it can help but you can use <a href="http://github.com/benoitc/couchc" target="_blank">http://github.com/benoitc/couchc</a> which abstract the internal couchdb api .<div>
<br></div><div>- benoitc<div><div class="h5"><span></span><br><br>On Friday, August 9, 2013, Yves S. Garret wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I have a small database that's running right now in CouchDB, it's called sample_database. What I'd</div>
<div>like to do is to read, create, delete, update documents and run some of the views inside from an </div>
<div>Erlang app. I looked online and found this example:</div><div><a href="http://www.softwarepassion.com/importing-data-to-couchdb-java-ruby-and-erlang-way/" target="_blank">http://www.softwarepassion.com/importing-data-to-couchdb-java-ruby-and-erlang-way/</a><br>
</div><div><br></div><div>From that, I proceeded to make the following little script:</div><div><div>-module(test).</div><div><br></div><div>-import(queue,[in/1,out/1,new/0]).</div><div>-export([start/0]).</div><div>-include("../couch_db.hrl").</div>
<div><br></div><div>-define(ADMIN_USER_CTX, {user_ctx, #user_ctx{roles = [<<"_admin">>]}}).</div><div><br></div><div>start() -></div><div> io:format("Hello world!~n~n"),</div><div><br>
</div>
<div> couch_db:open(<<"sample_database">>, [?ADMIN_USER_CTX]).</div></div><div><br></div><div>However, when I run this, I get the following error:</div><div><div>18> test:start().</div><div>Hello world!</div>
<div><br></div><div>** exception error: undefined function couch_db:open/2</div></div><div><br></div><div>It's obvious I'm not including a library of some sort. I'm curious how I can connect to my little </div>
<div>database in the simplest way possible just to start with. Has anyone done this before?<br></div></div>
</blockquote></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">Thanks. I believe I've resolved most of my problems already, but this is a welcome addition to my</div><div class="gmail_extra">little bag of tricks.</div></div>