Kivik 2.0.0-pre1 Released
The long-awaited Kivik 2.0.0 is nearing release
Jun 9, 2019 • Jonathan Hall
I’m happy to announce that Kivik v2.0.0-pre1 has now been tagged! This version number applies to the following public packages:
- kivik, the main Kivik library
- couchdb, the CouchDB driver
- pouchdb, the PouchDB driver
- kivikmock, the new Kivik mocking driver
This new version includes a few major enhancements, as well as a much larger number of minor changes. Some of these changes break backward compatibility with the v1 series, so some care must be taken when upgrading.
An overview of the biggest changes to each package is below.
- Various API changes, to improve usability. When upgrading from v1, you will notice compilation errors where function signatures have changes, but the necessary changes should be pretty self-explanatory.
- Improved error reporting. Go 1.13 will have some new standard error features. Prior to the Go 1.13 release, these features are available with the golang.org/x/xerrors package. Kivik v2.0.0 takes advantage of these enhancements. Some error values are still subject to change prior to the final release of Kivik v2.0.0.
- A new driver, kivikmock has been added. Inspired by go-sqlmock, this driver allows mocking all database requests, for use in automated tests.
- When querying views (via
AllDocs(), or similar), key-related fields are now JSON-encoded by Kivik. This simplifies the use of this endpoint, but is a breaking change, as previously, raw JSON objects were required. You may still pass a raw JSON object by passing a key of type
- Began switching to strictly using
http.Status*codes, rather than kivik-specific ones.
Changes()method was modified to support all supported modes (except
eventsource). Previously, only
continuousmode was supported.
Attachmenttype was completely rewritten.
BulkGet()support was added, to call the
Ping()support was added, which queries the new
/_upendpoint, when available, to report that the database is ready or not.
DBsStats()support was added, to query the new
User-Agentstring is now set for outbound requests
Purge()support was added, to query the
LocalDocs()support was added, to call the new
- When calling
Get(), if attachments are returned, they are now returned with a new, experimental
AttachmentsIterator, to allow for more efficient retrieval of attachments from CouchDB, using
multipart/relateddata rather than Base64-encoded binary attachments.
The final version of Kivik 2.0.0 should be released in aproximately 30 days.