couchdb v0.4.0 Release Notes
Release Date: 2016-01-03 // over 8 years ago-
๐ This release introduces several breaking changes to improve type-safety and ease-of-use, as well as to fix inconsistencies between the crate's API and the CouchDB API.
๐ฅ Breaking changes
- The path types of v0.3.x (e.g.,
DocumentPath
, etc.) are now split into path, id, and name types (e.g.,DocumentPath
,DocumentId
, andDocumentName
, etc.). Client commands use path types as input; id and name types are used everywhere else to match what the CouchDB API uses.- Paths now must begin with a slash (e.g.,
/db/docid
vs thedb/docid
format of v0.3.x). - Path types now implement
std::str::FromStr
instead ofFrom<String>
. This means string-to-path conversions now may fail.
- Paths now must begin with a slash (e.g.,
- The
Revision
type now fully understands CouchDB revisions.- The
Revision
type now implementsstd::str::FromStr
instead ofFrom<&str>
andFrom<String>
. This means string-to-revision conversion now may fail. - The
Revision
type no longer implementsAsRef<str>
. - Revisions now compare as numbers, not strings, to match what the CouchDB server does.
- The
- ๐จ The
Error
enum has been refactored to be simpler.- Many error variants documented in v0.3.x are now hidden or removed. The remaining variants are either CouchDB response errors or are for path-parsing.
- All CouchDB response error values are now wrapped in an
Option
to reflect how the CouchDB server returns no detailed error information for HEAD requests. - All non-hidden error variant values are now tuples, not structs.
- The
InvalidRequest
error variant has been renamed toBadRequest
. The new name matches HTTP status code 400 of the same name.
๐ Fixes
- When getting a document, the client now ignores any
_attachments
field in the CouchDB response. Previously, the client included the attachment info in the document content. - The client no longer tries to decode the server's response as JSON when the client receives an "unauthorized" error as a result of executing a client command to HEAD a document.
โ Additional notes
- โ Test coverage has expanded, and test cases have been broken out into smaller cases. Consequently, there are now more than 200 additional test cases than in the v0.3.1 release.
- The source code has been reorganized to be more hierarchical. CouchDB types, path types, and client commands now reside within distinct submodules.
- The path types of v0.3.x (e.g.,