You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Mark Hammond (JIRA)" <ji...@apache.org> on 2009/08/04 06:41:14 UTC

[jira] Created: (COUCHDB-446) allow list function and view function to be in different design docs.

allow list function and view function to be in different design docs.
---------------------------------------------------------------------

                 Key: COUCHDB-446
                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
             Project: CouchDB
          Issue Type: New Feature
          Components: Database Core
            Reporter: Mark Hammond
             Fix For: 0.10
         Attachments: x_doc_list.patch

There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.

I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744262#action_12744262 ] 

Chris Anderson commented on COUCHDB-446:
----------------------------------------

crucial to my last comment yet untyped:

It'd be nice to make lists work on built in views like _all_docs and _changes.

not for this patch, but just as long as we are on the topic of unified APIs...

I think this patch is ready to go in.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jason Davies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744013#action_12744013 ] 

Jason Davies commented on COUCHDB-446:
--------------------------------------

Is there another use case for having separate design documents, aside from being able to use different languages for a view and a list?

An alternative solution would be to allow a per-view/list language override, not sure how messy that would be in the query server handling, but it avoids the problem of design docs living on different nodes.  But there may be other use cases that this patch solves too.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12743992#action_12743992 ] 

Mark Hammond commented on COUCHDB-446:
--------------------------------------

Note this test doesn't use a json response (it is HTML), so it can't use JSON.parse...

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744257#action_12744257 ] 

Paul Joseph Davis commented on COUCHDB-446:
-------------------------------------------

I'm ok with this. There was a comment somewhere about just adding a language to each list function, but if we're gonna do that then I'd say we should make language specifiable for all functions on a design doc individually. But that'd probably be a pretty big effort, so I'd still be ok with putting this in as a stop gap until we decide what to do for any major changes.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Chris Anderson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744260#action_12744260 ] 

Chris Anderson commented on COUCHDB-446:
----------------------------------------

I think this stuff is gonna be messy with options eventually anyway.

Three cheers to anyone who thinks of a nice way to do a unified API.

+1 on putting this patch in.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738954#action_12738954 ] 

Jan Lehnardt commented on COUCHDB-446:
--------------------------------------

Mark can you use JSON.parse(xhr.responseText) instead of the regex matching in the tests?

More of a cosmetic remark: TEquals(expected, actual, testName); is preferred over T() (but we're not strict about that)

Other than that, the patch looks good.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Lehnardt updated COUCHDB-446:
---------------------------------

    Attachment: x_doc_list_jan.patch

Updated patch to latest trunk. It looks solid. 

The once caveat with this is that we will need to special-case in the future when the design docs live on different nodes. Do we want that?

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738958#action_12738958 ] 

Jan Lehnardt commented on COUCHDB-446:
--------------------------------------

if a TEquals() (or whatever name) test blows up it is easier to find & debug, hence the preference. maybe I should add that to the coding guide :)

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jan Lehnardt closed COUCHDB-446.
--------------------------------

    Resolution: Fixed

Applied in r805201.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744221#action_12744221 ] 

Mark Hammond commented on COUCHDB-446:
--------------------------------------

What is the status of approval for this patch?  It seems to have been approved in principal by Jan back when the patch was uploaded, then yesterday in IRC Jan rejected the concept, but yesterday in this bug appeared to re-approve the concept.  I'm getting somewhat mixed-messages.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Jan Lehnardt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12744247#action_12744247 ] 

Jan Lehnardt commented on COUCHDB-446:
--------------------------------------

@Markh, my comments on that patch were my own, not an official statement.

I didn't think of the concern I have now when I originally told you the patch looked good and I wanted to discuss the issue with the other developers.

dev@, comments please :)

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch, x_doc_list_jan.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Mark Hammond (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Hammond updated COUCHDB-446:
---------------------------------

    Attachment: x_doc_list.patch

addresses issue, including test.

> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-446) allow list function and view function to be in different design docs.

Posted by "Paul Joseph Davis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12738956#action_12738956 ] 

Paul Joseph Davis commented on COUCHDB-446:
-------------------------------------------

I agree, we should use T() tests instead of regexp.

I prefer T to TEquals. But TE would be ok. or T.eq(). But don't consider this a beginning of a 'discussion' that ends up with me saying 'fine if you want TyesIreallyreallywantthefirstargtobethesameasthesecondarg() then so be it'.



> allow list function and view function to be in different design docs.
> ---------------------------------------------------------------------
>
>                 Key: COUCHDB-446
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-446
>             Project: CouchDB
>          Issue Type: New Feature
>          Components: Database Core
>            Reporter: Mark Hammond
>             Fix For: 0.10
>
>         Attachments: x_doc_list.patch
>
>
> There has been some discussion on #couchdb how it might be desirable to use a list function where the list and the view are in separate documents.  Among the use-cases is so a list and view can use different languages.
> I'm attaching a patch which extends the URL syntax for list views - before my patch, the last portion of the path must be a view name.  My patch allows for the existing behaviour, or for the tail to be 2 elements - another design document name *and* the view name.  Includes a test.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.