Merge lp:~mandel/desktopcouch/batch_update into lp:desktopcouch
Proposed by
Manuel de la Peña
Status: | Merged |
---|---|
Approved by: | Chad Miller |
Approved revision: | not available |
Merged at revision: | not available |
Proposed branch: | lp:~mandel/desktopcouch/batch_update |
Merge into: | lp:desktopcouch |
Diff against target: |
67 lines (+46/-0) 2 files modified
desktopcouch/records/server_base.py (+26/-0) desktopcouch/records/tests/test_server.py (+20/-0) |
To merge this branch: | bzr merge lp:~mandel/desktopcouch/batch_update |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
John O'Brien (community) | Approve | ||
Stuart Langridge (community) | Approve | ||
Eric Casteleijn (community) | Approve | ||
Review via email: mp+17482@code.launchpad.net |
Commit message
Add put_records_
To post a comment you must log in.
The patch adds a put_records_batch method that puts a batch of docs in the db and a test that ensures that works as expected. The docs are added using a single request while the attachments are added one by one.
The result is a tuple of the form ``(success, docid, rev_or_exc)``, where ``success`` is a boolean indicating whether the update succeeded, ``docid`` is the ID of the document, and ``rev_or_exc`` is either the new document revision, or an exception instance (e.g. `ResourceConflict`) if the update failed.
Use case: Add a group of contacts to a category/tag
Concerns: If an attachment fails the doc are not rolled back. This same behavior if found in the single put_record method.