don't use temp views
Bug #401786 reported by
Elliot Murphy
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
desktopcouch |
Fix Released
|
High
|
Chad Miller |
Bug Description
temp views are going away, and should not be used under the hood in desktopcouch.
Related branches
lp:~cmiller/desktopcouch/excise-temporary-views
Merged
into
lp:desktopcouch
- Joshua Blount (community): Approve
- Stuart Langridge (community): Approve
- Diff: None lines
Changed in desktopcouch: | |
assignee: | nobody → Eric Casteleijn (thisfred) |
Changed in desktopcouch: | |
milestone: | none → w15 |
Changed in desktopcouch: | |
status: | Triaged → In Progress |
Changed in desktopcouch: | |
assignee: | Eric Casteleijn (thisfred) → Chad Miller (cmiller) |
Changed in desktopcouch: | |
status: | In Progress → Fix Released |
To post a comment you must log in.
The CouchDB approach is to not use temp views at all, which is why they're being removed; they're very inefficient. Instead, what you need to do is:
1. create a design document with your view in it
2. call that view to get your data
(This is akin to creating a stored procedure and then calling it, rather than making ad-hoc SQL queries, in an RDBMS).
We need to change our API to include the following:
def add_view(view_name, javascript_code, design_ doc_id= "design" )
a function to add a new view to a specific design document (or to a "design" design document if unspecified)
This is really about education: people using our API need to understand that the way to do this properly is to follow the two-step process above, rather than doing ad-hoc temporary queries. The documentation in desktopcouch/ records/ doc/records. txt needs to be updated to describe this more proper approach, and to show how to test if a design document exists and create it if it does not.