Package kivik provides a generic interface to CouchDB or CouchDB-like databases.
The kivik package must be used in conjunction with a database driver.
The kivik driver system is modeled after the standard library's sql and sql/driver packages, although the client API is completely different due to the different database models implemented by SQL and NoSQL databases such as CouchDB.
Nobody has ever asked me any of these questions, so they're probably better called "Never Asked Questions" or possibly "Imagined Questions."
A few reasons:
- I'm not happy with any of the existing ones. The best existing one seems to be https://github.com/fjl/go-couchdb, but it has several shortcomings:
- It's not being actively developed. The author has not responded to any pull requests or issues for over two years, from what I can tell.
- It doesn't have an open source license. In fact, it has no license at all, which, strictly speaking, means it should not ever be used by anyone without permission (which is presently impossible to acquire, thanks to the author not responding to issues).
- It doesn't support iterating over result sets, forcing one to load all results of a query into memory at once.
- It doesn't support CouchDB 2.0. The API differences between 1.6.1 and 2.0 are minor, but they do exist.
- It doesn't natively support CookieAuth (it does allow a generic Auth method which could be used to do this, but I think it's appropriate to put directly in the library).
- It doesn't support the new MongoDB-style
/_find
interface now available in CouchDB 2.0 (also present in PouchDB).
-
I want a single client API that works with both CouchDB and PouchDB. I have previously written go-pouchdb, which is a GopherJS wrapper around the PouchDB library. And I modeled my go-pouchdb API after fjl/go-couchdb. But they're still separate libraries. One of kivik's main design goals is to allow the exact same API to access both, in the same way that the standard library's sql package allows the same API to access MySQL, PostgreSQL, SQLite, or any other SQL database.
-
I want an unambiguous, open source license. This software is released under the Apache 2.0 license. See the included LICENSE.md file for details.
-
I want the ability to mock CouchDB connections for testing. This is possible with the sql / sql/driver approach, by implementing a mock driver, but was not possible with any existing CouchDB client libraries. This library intends to remedy that.
-
In the future, I intend to expand kivik to support a 'serve' mode. This will allow running a minimal stand-alone CouchDB server or proxy, for the purpose of testing. My personal goal is to run a kivik server with a memory backend, so that I can test a CouchDB app, or PouchDB syncing, against my kivik server, without the administrative overhead of installing a full-fledged CouchDB instance. If successful, this opens up additional possibilities of creating simple CouchDB proxy servers, which could be quite interesting.
Kivik is in early stages of development. At the moment, the client libraries are nearly complete for both CouchDB and PouchDB. My development goals are, in rough order of priority:
- Complete the 'kivik' client API.
- Complete the CouchDB driver.
- Complete the PouchDB driver.
- Complete the Memory driver.
- Write a 'serve' mode.
1-3 are being done roughly in parallel, although the features of the various drivers are not entirely identical. When the CouchDB and PouchDB drivers are essentially complete, I'll work on fleshing out the Memory driver, which will make automated testing without a real CouchDB server easier. Then I will work on completing the 'serve' mode.
You can see a complete overview of the current status on the Compatibility chart
Kivik is a line of sofas (couches) from IKEA. And in the spirit of IKEA, and build-your-own furniture, Kivik aims to allow you to "build your own" CouchDB client, server, and proxy applications.
This software is released under the terms of the Apache 2.0 license. See LICENCE.md, or read the full license.