couchclient 0.5.1

  • Installing
  • Versions
  • 3


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

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.4.0