couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <jch...@gmail.com>
Subject Re: _show API (née _form)
Date Mon, 12 Jan 2009 20:12:54 GMT
On Mon, Jan 12, 2009 at 11:57 AM, Ulises <ulises.cervino@gmail.com> wrote:
>> A) GET /db/_show_view/mydesign/myview
>> B) GET /db/_show_view/mydesign/myshowfunc/myview
>> C) GET /db/_view/mydesign/myview?strartkey="foo"&show=myshowfunc
>
> Call me thick but C looks cleaner to me.
>
>> {
>> ...
>> "show" : {
>>  "docs" : { ... },
>>  "views" : {
>>    "myshowfunc" : "function(row, head) { ... }"
>>  }
>> }
>
> how about including your show fns in show { } ?

that's what's above

show funcs for documents are at

ddoc.show.docs

and show funcs for views are at

ddoc.show.views


I'm leaning B or C as well.

My main reservation about C is what it will do to the internals.
Erlang actions that are scoped to a _private_path URL can be kept in
their own module and moved around via the config API. If we amke it an
options on regular views, we lose that freedom.

Also, I do like the current URL scheme for document show funcs, partly
for the config reason, but also because I think

GET /db/_show/mydesign/myshowfunc/docid

is clearer than

GET /db/docid?show=mydesign/myshowfun

>
> {
> ...
>  views: {
>    foo : { map : ... }
>  },
>  show: {
>    as_xml: function(...) { ... },
>  }
> }
>
>> I'm leaning toward letting the user decide at query-time which view to
>> render using which show-func, that is, options B or C.
>
> Well I thought that that was a given, flexibility so that users can
> define a couple of views, a couple of shows so that the combinations
> then are more useful.
>
> U
>



-- 
Chris Anderson
http://jchris.mfdz.com

Mime
View raw message