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, and DocumentName, 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 the db/docid format of v0.3.x).
      • Path types now implement std::str::FromStr instead of From<String>. This means string-to-path conversions now may fail.
    • The Revision type now fully understands CouchDB revisions.
      • The Revision type now implements std::str::FromStr instead of From<&str> and From<String>. This means string-to-revision conversion now may fail.
      • The Revision type no longer implements AsRef<str>.
      • Revisions now compare as numbers, not strings, to match what the CouchDB server does.
    • ๐Ÿ”จ 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 to BadRequest. 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.