You are viewing a plain text version of this content. The canonical link for it is here.
Posted to erlang@couchdb.apache.org by Alexander Shorin <kx...@gmail.com> on 2012/10/17 17:51:42 UTC

Erlang design documents

Hi, Couchers!

Probably this question is not about how to hack into CouchDB internals
with Erlang, but how to use Erlang with CouchDB. Since there is native
support of Erlang query server it's reasonable to try use Erlang ddoc
functions to solve bottlenecks (Erlang filters are extremely fast) and
just use Erlang to write couchapps. Since there is a lot of
information about JavaScript couchapps, I feel confused with trying to
write non-hello-world Erlang functions: shows/lists/vdu. While
JavaScript one has special execution context (provides, registerType,
start, send, getRow, require etc.) I wonder what could be used with
Erlang. Is there getRow function and how it supposed to work? What
about others? CommonJS modules interface is supported or there is
another, better way to import inline ddoc modules?

I think this information would be useful for all of us. Thanks(:

--
,,,^..^,,,

Re: Erlang design documents

Posted by Robert Newson <rn...@apache.org>.
Hi,

The relevant code is in couch_native_process.erl and is, afaik, the
best documentation on the rarely-used native view server.

Functions are declared in bindings/3 and named as follows;

Log
Emit
Start
Send
GetRow
FoldRows

CommonJS is not supported in the native view server.

Finally, and obviously, this view server is not well documented, and
perhaps usage should be discouraged as there is no sandbox, any
command can be executed as the user that couchdb is running as within
any callback function (which is one compelling reason not to run
couchdb as root, among many).

B.

On 23 October 2012 11:24, Noah Slater <ns...@apache.org> wrote:
> Hmm. No responses? 69 subscribers. I'm sure we can do better than that.
> Come on, folks! ;)
>
> On 17 October 2012 16:51, Alexander Shorin <kx...@gmail.com> wrote:
>
>> Hi, Couchers!
>>
>> Probably this question is not about how to hack into CouchDB internals
>> with Erlang, but how to use Erlang with CouchDB. Since there is native
>> support of Erlang query server it's reasonable to try use Erlang ddoc
>> functions to solve bottlenecks (Erlang filters are extremely fast) and
>> just use Erlang to write couchapps. Since there is a lot of
>> information about JavaScript couchapps, I feel confused with trying to
>> write non-hello-world Erlang functions: shows/lists/vdu. While
>> JavaScript one has special execution context (provides, registerType,
>> start, send, getRow, require etc.) I wonder what could be used with
>> Erlang. Is there getRow function and how it supposed to work? What
>> about others? CommonJS modules interface is supported or there is
>> another, better way to import inline ddoc modules?
>>
>> I think this information would be useful for all of us. Thanks(:
>>
>> --
>> ,,,^..^,,,
>>
>
>
>
> --
> NS

Re: Erlang design documents

Posted by Noah Slater <ns...@apache.org>.
Hmm. No responses? 69 subscribers. I'm sure we can do better than that.
Come on, folks! ;)

On 17 October 2012 16:51, Alexander Shorin <kx...@gmail.com> wrote:

> Hi, Couchers!
>
> Probably this question is not about how to hack into CouchDB internals
> with Erlang, but how to use Erlang with CouchDB. Since there is native
> support of Erlang query server it's reasonable to try use Erlang ddoc
> functions to solve bottlenecks (Erlang filters are extremely fast) and
> just use Erlang to write couchapps. Since there is a lot of
> information about JavaScript couchapps, I feel confused with trying to
> write non-hello-world Erlang functions: shows/lists/vdu. While
> JavaScript one has special execution context (provides, registerType,
> start, send, getRow, require etc.) I wonder what could be used with
> Erlang. Is there getRow function and how it supposed to work? What
> about others? CommonJS modules interface is supported or there is
> another, better way to import inline ddoc modules?
>
> I think this information would be useful for all of us. Thanks(:
>
> --
> ,,,^..^,,,
>



-- 
NS