couchclient 0.5.1

  • Installing
  • Versions
  • 0


CouchClient is the client SDK that enables accessing to the NoSQL document database Couchbase in Dart language.

CouchClient is distributed under the Apache 2.0 License.

##Install from Dart Pub Repository

Add this to your pubspec.yaml (or create it):


Then run the Pub Package Manager (comes with the Dart SDK):

pub install

##Install from Github for Bleeding Edge Stuff

To install stuff that is still in development, add this to your pubspec.yam:

    git: git://

For more information, please refer to [Pub: Dependencies] (


Using CouchClient is straightforward. Connect to the server and use the client's APIs to access the database.

import "dart:uri";
import "dart:convert";
import "dart:async";
import "package:couchclient/couchclient.dart";

void main() {
  // Connect to server per the provided Uris
  // Here assume your Couchbase Server is installed on localhost
  // Use "default" bucket with no password
  CouchClient.connect([Uri.parse("")], "default", "")
  // When client is ready, access the database
  .then((client) => access(client))
  // Catch all possible errors/exceptions
  .catchError((err) => print('Exception: $err'));

// The unique document id of the document
final String DOC_ID = "beer_Wrath";

// The Json encoded document
final String VALUE =
  '"updated":"2010-07-22 20:00:20",'
  '"description":"WRATH Belgian-style ",'
  '"style":"Other Belgian-Style Ales",'
  '"category":"Belgian and French Ale"}';

Future access(CouchClient client) {
  // Do a set
  return client.set(DOC_ID, UTF8.encode(VALUE))
  // Check if set succeeded and show message
  .then((ok) => print(ok ? "Set Succeeded" : "Set failed"))
  // Then get the value back by document id
  .then((_) => client.get(DOC_ID))
  // Check if get data equals to set one
  .then((val) => UTF8.decode( == VALUE)
  // Show message
  .then((ok) => print(ok ? "Get Succeeded" : "Get failed"))
  // Close the client
  .then((_) => client.close());

##Notes to Contributors

###Test and Debug

You are welcome to submit [bugs and feature requests] ( Or even better if you can fix or implement them!

###Fork CouchClient

If you'd like to contribute back to the core, you can [fork this repository] ( and send us a pull request, when it is ready.

Please be aware that one of CouchClient's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  couchclient: ^0.5.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:couchclient/couchclient.dart';
Version Uploaded Documentation Archive
0.5.1 Jun 26, 2014 Go to the documentation of couchclient 0.5.1 Download couchclient 0.5.1 archive
0.5.0 Jun 25, 2014 Go to the documentation of couchclient 0.5.0 Download couchclient 0.5.0 archive
0.4.1+1 Oct 30, 2013 Go to the documentation of couchclient 0.4.1+1 Download couchclient 0.4.1+1 archive
0.4.1 Oct 30, 2013 Go to the documentation of couchclient 0.4.1 Download couchclient 0.4.1 archive
0.4.0+2 Sep 12, 2013 Go to the documentation of couchclient 0.4.0+2 Download couchclient 0.4.0+2 archive
0.4.0+1 Sep 9, 2013 Go to the documentation of couchclient 0.4.0+1 Download couchclient 0.4.0+1 archive
0.4.0 Aug 20, 2013 Go to the documentation of couchclient 0.4.0 Download couchclient 0.4.0 archive
0.3.0+7 Jun 17, 2013 Go to the documentation of couchclient 0.3.0+7 Download couchclient 0.3.0+7 archive
0.3.0+6 Jun 11, 2013 Go to the documentation of couchclient 0.3.0+6 Download couchclient 0.3.0+6 archive
0.3.0+5 Jun 7, 2013 Go to the documentation of couchclient 0.3.0+5 Download couchclient 0.3.0+5 archive

All 17 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.1.0.
 Because couchclient depends on memcached_client any which requires SDK version <2.0.0, version solving failed.

Health suggestions

Format lib/src/CouchClient.dart.

Run dartfmt to format lib/src/CouchClient.dart.

Format lib/src/DesignDoc.dart.

Run dartfmt to format lib/src/DesignDoc.dart.

Format lib/src/ObservedException.dart.

Run dartfmt to format lib/src/ObservedException.dart.

Fix additional 63 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/ObservedModifiedException.dart (Run dartfmt to format lib/src/ObservedModifiedException.dart.)
  • lib/src/ObservedTimeoutException.dart (Run dartfmt to format lib/src/ObservedTimeoutException.dart.)
  • lib/src/PersistTo.dart (Run dartfmt to format lib/src/PersistTo.dart.)
  • lib/src/Query.dart (Run dartfmt to format lib/src/Query.dart.)
  • lib/src/ReplicateTo.dart (Run dartfmt to format lib/src/ReplicateTo.dart.)
  • lib/src/SpatialView.dart (Run dartfmt to format lib/src/SpatialView.dart.)
  • lib/src/Stale.dart (Run dartfmt to format lib/src/Stale.dart.)
  • lib/src/View.dart (Run dartfmt to format lib/src/View.dart.)
  • lib/src/ViewDesign.dart (Run dartfmt to format lib/src/ViewDesign.dart.)
  • lib/src/ViewResponse.dart (Run dartfmt to format lib/src/ViewResponse.dart.)
  • lib/src/ViewRow.dart (Run dartfmt to format lib/src/ViewRow.dart.)
  • lib/src/ViewRowError.dart (Run dartfmt to format lib/src/ViewRowError.dart.)
  • lib/src/config/Bucket.dart (Run dartfmt to format lib/src/config/Bucket.dart.)
  • lib/src/config/BucketMonitor.dart (Run dartfmt to format lib/src/config/BucketMonitor.dart.)
  • lib/src/config/BucketUpdateResponseHandler.dart (Run dartfmt to format lib/src/config/BucketUpdateResponseHandler.dart.)
  • lib/src/config/CacheConfig.dart (Run dartfmt to format lib/src/config/CacheConfig.dart.)
  • lib/src/config/ConfigDifference.dart (Run dartfmt to format lib/src/config/ConfigDifference.dart.)
  • lib/src/config/ConfigFactory.dart (Run dartfmt to format lib/src/config/ConfigFactory.dart.)
  • lib/src/config/ConfigParserJson.dart (Run dartfmt to format lib/src/config/ConfigParserJson.dart.)
  • lib/src/config/ConfigProvider.dart (Run dartfmt to format lib/src/config/ConfigProvider.dart.)
  • lib/src/config/ConfigType.dart (Run dartfmt to format lib/src/config/ConfigType.dart.)
  • lib/src/config/DefaultConfig.dart (Run dartfmt to format lib/src/config/DefaultConfig.dart.)
  • lib/src/config/Node.dart (Run dartfmt to format lib/src/config/Node.dart.)
  • lib/src/config/Pool.dart (Run dartfmt to format lib/src/config/Pool.dart.)
  • lib/src/config/Port.dart (Run dartfmt to format lib/src/config/Port.dart.)
  • lib/src/config/ReconfigurableObserver.dart (Run dartfmt to format lib/src/config/ReconfigurableObserver.dart.)
  • lib/src/config/Status.dart (Run dartfmt to format lib/src/config/Status.dart.)
  • lib/src/config/Vbucket.dart (Run dartfmt to format lib/src/config/Vbucket.dart.)
  • lib/src/op/rest/AuthType.dart (Run dartfmt to format lib/src/op/rest/AuthType.dart.)
  • lib/src/op/rest/BucketType.dart (Run dartfmt to format lib/src/op/rest/BucketType.dart.)
  • lib/src/op/rest/CreateBucketOP.dart (Run dartfmt to format lib/src/op/rest/CreateBucketOP.dart.)
  • lib/src/op/rest/ListBucketsOP.dart (Run dartfmt to format lib/src/op/rest/ListBucketsOP.dart.)
  • lib/src/op/rest/ListDesignDocsOP.dart (Run dartfmt to format lib/src/op/rest/ListDesignDocsOP.dart.)
  • lib/src/op/views/DeleteDesignDocOP.dart (Run dartfmt to format lib/src/op/views/DeleteDesignDocOP.dart.)
  • lib/src/op/views/DeleteHttpOP.dart (Run dartfmt to format lib/src/op/views/DeleteHttpOP.dart.)
  • lib/src/op/views/DocsOP.dart (Run dartfmt to format lib/src/op/views/DocsOP.dart.)
  • lib/src/op/views/GetDesignDocOP.dart (Run dartfmt to format lib/src/op/views/GetDesignDocOP.dart.)
  • lib/src/op/views/GetHttpOP.dart (Run dartfmt to format lib/src/op/views/GetHttpOP.dart.)
  • lib/src/op/views/GetSpatialViewOP.dart (Run dartfmt to format lib/src/op/views/GetSpatialViewOP.dart.)
  • lib/src/op/views/GetViewOP.dart (Run dartfmt to format lib/src/op/views/GetViewOP.dart.)
  • lib/src/op/views/HttpOP.dart (Run dartfmt to format lib/src/op/views/HttpOP.dart.)
  • lib/src/op/views/HttpOPChannel.dart (Run dartfmt to format lib/src/op/views/HttpOPChannel.dart.)
  • lib/src/op/views/NoDocsOP.dart (Run dartfmt to format lib/src/op/views/NoDocsOP.dart.)
  • lib/src/op/views/OnErrorType.dart (Run dartfmt to format lib/src/op/views/OnErrorType.dart.)
  • lib/src/op/views/PostHttpOP.dart (Run dartfmt to format lib/src/op/views/PostHttpOP.dart.)
  • lib/src/op/views/PutDesignDocOP.dart (Run dartfmt to format lib/src/op/views/PutDesignDocOP.dart.)
  • lib/src/op/views/PutHttpOP.dart (Run dartfmt to format lib/src/op/views/PutHttpOP.dart.)
  • lib/src/op/views/SpatialViewRowNoDocs.dart (Run dartfmt to format lib/src/op/views/SpatialViewRowNoDocs.dart.)
  • lib/src/op/views/SpatialViewRowWithDocs.dart (Run dartfmt to format lib/src/op/views/SpatialViewRowWithDocs.dart.)
  • lib/src/op/views/ViewResponseNoDocs.dart (Run dartfmt to format lib/src/op/views/ViewResponseNoDocs.dart.)
  • lib/src/op/views/ViewResponseReduced.dart (Run dartfmt to format lib/src/op/views/ViewResponseReduced.dart.)
  • lib/src/op/views/ViewResponseWithDocs.dart (Run dartfmt to format lib/src/op/views/ViewResponseWithDocs.dart.)
  • lib/src/op/views/ViewRowNoDocs.dart (Run dartfmt to format lib/src/op/views/ViewRowNoDocs.dart.)
  • lib/src/op/views/ViewRowReduced.dart (Run dartfmt to format lib/src/op/views/ViewRowReduced.dart.)
  • lib/src/op/views/ViewRowWithDocs.dart (Run dartfmt to format lib/src/op/views/ViewRowWithDocs.dart.)
  • lib/src/spi/CouchClientImpl.dart (Run dartfmt to format lib/src/spi/CouchClientImpl.dart.)
  • lib/src/spi/CouchbaseConnection.dart (Run dartfmt to format lib/src/spi/CouchbaseConnection.dart.)
  • lib/src/spi/CouchbaseConnectionFactory.dart (Run dartfmt to format lib/src/spi/CouchbaseConnectionFactory.dart.)
  • lib/src/spi/CouchbaseMemcachedConnection.dart (Run dartfmt to format lib/src/spi/CouchbaseMemcachedConnection.dart.)
  • lib/src/spi/RestClientImpl.dart (Run dartfmt to format lib/src/spi/RestClientImpl.dart.)
  • lib/src/spi/RestConnection.dart (Run dartfmt to format lib/src/spi/RestConnection.dart.)
  • lib/src/spi/VbucketNodeLocator.dart (Run dartfmt to format lib/src/spi/VbucketNodeLocator.dart.)
  • lib/src/spi/ViewConnection.dart (Run dartfmt to format lib/src/spi/ViewConnection.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.

Package is too old. (-100 points)

The package was released more than two years ago.

Maintain (-20 points)

Changelog entries help clients to follow the progress in your code.

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use couchclient.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.4.0