Name Date Size

..11-Jan-20224 KiB

.clang-formatH A D11-Jan-2022241

.gitignoreH A D11-Jan-20222 KiB

cmake/H11-Jan-20224 KiB

CMakeLists.txtH A D11-Jan-202218 KiB

configure.plH A D11-Jan-20228.4 KiB

contrib/H11-Jan-20224 KiB

CONTRIBUTING.mdH A D11-Jan-20224.7 KiB

doc/H11-Jan-20224 KiB

example/H11-Jan-20224 KiB

gyp_config/H11-Jan-20224 KiB

include/H11-Jan-20224 KiB

libcouchbase.gypH A D11-Jan-202211.9 KiB

LICENSEH A D11-Jan-202211.1 KiB

packaging/H11-Jan-20224 KiB

plugins/io/H11-Jan-20224 KiB

README.markdownH A D11-Jan-20226.9 KiB

RELEASE_NOTES.markdownH A D11-Jan-2022178.7 KiB

src/H11-Jan-20224 KiB

tests/H11-Jan-20224 KiB

tools/H11-Jan-20224 KiB

README.markdown

1# Couchbase C Client
2
3[![license](https://img.shields.io/github/license/couchbase/libcouchbase?color=brightgreen)](https://opensource.org/licenses/Apache-2.0)
4
5This is the C client library for [Couchbase](http://www.couchbase.com)
6It communicates with the cluster and speaks the relevant protocols
7necessary to connect to the cluster and execute data operations.
8
9## Features
10
11* Can function as either a synchronous or asynchronous library
12* Callback Oriented
13* Can integrate with most other asynchronous environments. You can write your
14  code to integrate it into your environment. Currently support exists for
15    * [libuv](http://github.com/joyent/libuv) (Windows and POSIX)
16    * [libev](http://software.schmorp.de/pkg/libev.html) (POSIX)
17    * [libevent](http://libevent.org/) (POSIX)
18    * `select` (Windows and POSIX)
19    * IOCP (Windows Only)
20* Support for operation batching
21* Cross Platform - Tested on Linux, OS X, and Windows.
22
23## Building
24
25Before you build from this repository, please check the
26[installation page](https://docs.couchbase.com/c-sdk/current/hello-world/start-using-sdk.html)
27to see if there is a binary or release tarball available for your needs. Since the code here is
28not part of an official release it has therefore not gone through our
29release testing process.
30
31### Dependencies
32
33By default the library depends on:
34
35* _libevent_ (or _libev_) for the primary I/O backend.
36* _openssl_ for SSL transport.
37* _CMake_ version 2.8.9 or greater (for building)
38
39On Unix-like systems these dependencies are checked for by default
40while on Windows they are not checked by default.
41
42On Unix, the build system will expect to have _libevent_ or _libev_ installed,
43unless building plugins is explicitly disabled (see further).
44
45### Building on Unix-like systems
46
47Provided is a convenience script called `cmake/configure`. It is a Perl
48script and functions like a normal `autotools` script.
49
50```shell
51$ git clone https://github.com/couchbase/libcouchbase.git
52$ cd libcouchbase && mkdir build && cd build
53$ ../cmake/configure
54$ make
55$ ctest
56```
57
58### Building on Windows
59
60Assuming `git` and Visual Studio 2010 are installed, from a `CMD` shell, do:
61
62```
63C:\> git clone https://github.com/couchbase/libcouchbase.git
64C:\> mkdir lcb-build
65C:\> cd lcb-build
66C:\> cmake -G "Visual Studio 10" ..\libcouchbase
67C:\> cmake --build .
68```
69
70This will generate and build a Visual Studio `.sln` file.
71
72Windows builds are known to work on Visual Studio versions 2008, 2010 and
732012.
74
75If you wish to link against OpenSSL, you should set the value of
76`OPENSSL_ROOT_DIR` to the location of the installation path, as described
77[here](https://github.com/Kitware/CMake/blob/master/Modules/FindOpenSSL.cmake)
78
79## Running tests
80
81To run tests, you can use either ctest directly or generated build targets.
82For Unix-like:
83
84```shell
85make test
86```
87
88For windows:
89
90```batchfile
91cmake --build . --target alltests
92ctest -C debug
93```
94
95By default tests will use [CouchbaseMock](https://github.com/couchbase/CouchbaseMock) project to simulate the Couchbase
96Cluster. It allows to cover more different failure scenarios, although does not implement all kinds of APIs provided
97by real server.
98
99If you need to test against real server, you have to provide comma-separated configuration in `LCB_TEST_CLUSTER_CONF`
100environment variable. For example, the following command will run tests against local cluster and bucket `default` using
101administrator credentials:
102
103```shell
104export LCB_TEST_CLUSTER_CONF=couchbase://localhost,default,Administrator,password
105make test
106```
107Note that specifying username will automatically switch to RBAC mode, which supported by Couchbase Server 5.0+. For old
108servers the spec will look like `couchbase://localhost,default` or `couchbase://localhost,protected,,secret`.
109
110Also tests expecting `beer-sample` bucket loaded. It comes with the server. Look at "Sample buckets" section of Admin
111Console.
112
113## Bugs, Support, Issues
114You may report issues in the library in our issue tracker at
115<https://issues.couchbase.com>. Sign up for an account and file an issue
116against the _Couchbase C Client Library_ project.
117
118The developers of the library hang out in IRC on `#libcouchbase` on
119irc.freenode.net.
120
121
122## Examples
123
124* The `examples` directory
125* Official client libraries using libcouchbase
126    * [node.js](http://github.com/couchbase/couchnode)
127    * [Python](http://github.com/couchbase/couchbase-python-client)
128    * [PHP](http://github.com/couchbase/php-couchbase)
129* Community projects using libcouchbase
130    * [C++11 wrapper](https://github.com/couchbaselabs/libcouchbase-cxx)
131    * [cberl - Couchbase NIF](https://github.com/wcummings/cberl)
132    * [Perl client](https://github.com/mnunberg/perl-Couchbase-Client)
133    * [Ruby](http://github.com/couchbase/couchbase-ruby-client) (uses the old < 2.6 API)
134
135## Documentation
136
137Documentation is available in guide format (introducing the basic concepts of
138Couchbase and the library). It is recommended for first-time users, and can
139be accessed at our [Documentation Site](https://developer.couchbase.com/documentation/server/current/sdk/c/start-using-sdk.html).
140
141API documentation is also available and is generated from the library's headers.
142It may contain references to more advanced features not found in the guide.
143
144API documentation may be generated by running `doxygen` within the source root
145directory. When this is done, you should have a `doc/html/index.html` page which
146may be viewed.
147
148Doxygen may be downloaded from the
149[doxygen downloads page](http://www.stack.nl/~dimitri/doxygen/download.html). Note
150however that most Linux distributions as well as Homebrew contain Doxygen in their
151repositories.
152
153```
154$ doxygen
155$ xdg-open doc/html/index.html # Linux
156$ open doc/html/index.html # OS X
157```
158
159You may also generate documentation using the `doc/Makefile` which dynamically
160inserts version information
161
162```
163$ make -f doc/Makefile public # for public documentation
164$ make -f doc/Makefile internal # for internal documentation
165```
166
167The generated documentation will be in the `doc/public/html` directory for
168public documentation, and in the `doc/internal/html` directory for internal
169documentation.
170
171## Contributors
172
173The following people contributed to libcouchbase (in alphabetic order)
174(last updated Nov. 27 2014)
175
176* Brett Lawson <brett19@gmail.com>
177* Dave Rigby <daver@couchbase.com>
178* Jan Lehnardt <jan@apache.org>
179* Mark Nunberg <mnunberg@haskalah.org>
180* Matt Ingenthron <ingenthr@cep.net>
181* Patrick Varley <patrick@couchbase.com>
182* Paul Farag <pfarag@neuraliq.com>
183* Pierre Joye <pierre.php@gmail.com>
184* Sebastian <sebastian@chango.com>
185* Sergey Avseyev <sergey.avseyev@gmail.com>
186* Subhashni Balakrishnan <b.subhashni@gmail.com>
187* Sundar Sridharan <sundar.sridharan@gmail.com>
188* Trond Norbye <trond.norbye@gmail.com>
189* Volker Mische <vmx@couchbase.com>
190* William Bowers <wbowers@neuraliq.com>
191* Yura Sokolov <funny.falcon@gmail.com>
192* Yury Alioshinov <haster2010@gmail.com>
193
194## License
195
196libcouchbase is licensed under the Apache 2.0 License. See `LICENSE` file for
197details.
198