This is the C client library for Couchbase It communicates with the cluster and speaks the relevant protocols necessary to connect to the cluster and execute data operations.
- Can function as either a synchronous or asynchronous library
- Callback Oriented
- Can integrate with most other asynchronous environments. You can write your code to integrate it into your environment. Currently support exists for
- Support for operation batching
- ANSI C ("C89")
- Cross Platform - Tested on Linux, OS X, and Windows.
Before you build from this repository, please check the Couchbase C Portal to see if there is a binary or release tarball available for your needs. Since the code here is not part of an official release it has therefore not gone through our release testing process.
For building you have two options; the first is via GNU autotools and the second is via CMake. Autotools provides more packaging flexibility while CMake integrates better into your normal (C/C++) development environment. CMake is also the only way to build the library on Windows.
The library comes with no mandatory third party dependencies; however
by default it will demand that at least
are installed as those are the most tested I/O platforms.
If you are building libcouchbase as a depdency for an application which
contains its own event loop implementation then you may specify the
--disable-plugins option to the configure script.
Additionally, in order to run the tests you will need to have java installed. The tests make use of a mock server written in Java.
The binary command line tools (i.e.
cbc) and tests require a C++
compiler. The core library requires only C.
In order to build with autotools you need to generate the
first. This requires
libtool and friends.
$ ./config/autorun.sh $ ./configure $ make $ make check $ make install
You may run
./configure --help to see a list of build options
Provided is a convenience script called
cmake/configure. It is a Perl
script and functions like a normal
$ mkdir lcb-build # sibling of the git tree $ cd lcb-build $ ../libcouchbase/cmake/configure $ make $ ctest
Spin up your visual studio shell and run cmake from there. It is best practice that you make an out-of-tree build; thus like so:
Assuming Visual Studio 2010
C:\> git clone git://github.com/couchbase/libcouchbase.git C:\> mkdir lcb-build C:\> cd lcb-build C:\> cmake -G "Visual Studio 10" ..\libcouchbase C:\> msbuild /M libcouchbase.sln
This will generate and build a Visual Studio
Windows builds are known to work on Visual Studio versions 2008, 2010 and 2012.
You may report issues in the library in our issue tracked at http://couchbase.com/issues. Sign up for an account and file an issue against the Couchbase C Client Library project.
The developers of the library hang out in IRC on
- Client libraries wrapping this library
- http://http://trondn.blogspot.com/2012/01/so-how-do-i-use-this-libcouchbase.html Old example based on version 1.x of the library
API Documentation exists inline with the headers in the
man-pages are also available in the
man directory and are installed via
In addition to filing bugs, you may contribute by submitting patches to fix bugs in the library. Contributions may be submitting to http://review.couchbase.com. We use Gerrit as our code review system - and thus submitting a change would require an account there. Note that pull requests will not be ignored but will be responded to much quicker once they are converted into Gerrit.
For something to be accepted into the codebase, it must be formatted properly and have undergone proper testing. While there are no formatting guidelines per se, the code should look similar to the existing code within the library.
Released versions of the library are marked as annotated tags inside the repository.
release10contains the older 1.x versions of the library.
masterbranch represents the mainline branch. The master branch typically consists of content going into the next release.
packet-ngbranch contains the next generation version of the library with improved packet handling.
libcouchbase is licensed under the Apache 2.0 License. See
LICENSE file for