Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New support for including the document in each view row #19

Closed
cmbrandenburg opened this issue Apr 2, 2016 · 1 comment
Closed

New support for including the document in each view row #19

cmbrandenburg opened this issue Apr 2, 2016 · 1 comment
Assignees
Milestone

Comments

@cmbrandenburg
Copy link
Collaborator

Add support for the include_docs query parameter when executing a view. Doing so will require changing the ViewRow type to optionally contain a Document.

It might be a good idea—either now or later—to make a new reference-counted document path type, similar to DocumentPath, whereby the database name component is stored as a std::rc::Rc<DatabaseName>. Otherwise, each view row containing a document will have a copy of the same database name, which could lead to a lot of allocations. I envision the reference-counted document path type to be an private type inside Chill.

The reference-counting idea is probably a bad idea. The std::rc::Rc type implements !Send, meaning Rc prevents anything containing it from moving to another thread. Having a Document (or ViewRow) contain an Rc would be prioritizing for efficiency over convenience—contrary to the central aim for Chill. For this specific case, it would be better merely to incur the cost of one extra allocation per document for the database name, as that cost will be lost in the noise of doing an HTTP round-trip with the CouchDB server.

@cmbrandenburg
Copy link
Collaborator Author

ViewResponseBuilder should be updated to support document inclusion for each row being constructed.

@cmbrandenburg cmbrandenburg modified the milestones: v0.2.0, v0.2.1 May 28, 2016
@cmbrandenburg cmbrandenburg self-assigned this Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants