Hi Dave,
I wanted to do a quick and dirty proof of concept, so I simply compiled
some Elixir code to .beam and placed that .beam alongside other couchdb's
beams. The .beam itself does not contain any calls to Elixir stdlib, so I
assumed it would work.
I've also tried using ERL_LIBS like this:
ERL_LIBS=/usr/local/lib/couchdb/erlang/lib/couch-1.3.1 couchdb -n -A .
didn't work. Although, running erl from the same directory works:
λ ERL_LIBS=/usr/local/lib/couchdb/erlang/lib/couch-1.3.1 erl
1> 'Elixir.CouchQuery':start_link().
{ok,<0.34.0>}
I thought CouchDB may be started in embedded mode, but failed to identify
that in the start script. My question is: why can't it find the newly added
.beam?
On Tue, Nov 12, 2013 at 10:10 AM, Dave Cottlehuber <[email protected]>wrote:
> On 12. November 2013 at 08:59:15, Alexei Sholik ([email protected])
> wrote:
> >
> > > So yes, Elixir please! :) And if we get a sandbox as well, we can
> > even
> > enable it by default :)
> >
> > I tried to add a .beam produced by Elixir to my CouchDB installation
> > (I
> > didn't want to rebuild the whole project), but Couch can't find
> > it. I
> > posted a question on this ML[1]. Any hints?
> >
> > [1]:
> >
> http://mail-archives.apache.org/mod_mbox/couchdb-dev/201308.mbox/%3ccaapy6eptsvstpywvqurnnxn0pwbfwmitee2gawjsphatv5i...@mail.gmail.com%3E
>
> Hey Alexei!
>
> Sorry I had this email marked in “must get to, still haven’t”.
>
> How are you starting couch? you should be able to set ERL_LIBS like any
> other Erlang/Elixir project, and drop it in there. It’s picked up in
> `couchdb` script, so alternatively you can hack that directly:
>
> https://github.com/apache/couchdb/blob/master/bin/couchdb.tpl.in
>
> Also, the new plugin interface in 1.5.0 might be what you want;
> https://github.com/apache/couchdb/blob/master/src/couch_plugins/README.md
>
> A+
> Dave
>
>
--
Best regards
Alexei Sholik