All Projects → couchbase → Couchbase Ruby Client

couchbase / Couchbase Ruby Client

Licence: apache-2.0
Couchbase Ruby Client Library (Official)

Programming Languages

ruby
36898 projects - #4 most used programming language

Labels

Projects that are alternatives of or similar to Couchbase Ruby Client

Youzan Sdk
👍有赞 SDK
Stars: ✭ 103 (-6.36%)
Mutual labels:  sdk
App Examples
Miro Apps Examples
Stars: ✭ 108 (-1.82%)
Mutual labels:  sdk
Ali Oss
Aliyun OSS(open storage service) JavaScript SDK for the browser and Node.js
Stars: ✭ 1,579 (+1335.45%)
Mutual labels:  sdk
Chat Sdk Android
Chat SDK Android - Open Source Mobile Messenger
Stars: ✭ 1,496 (+1260%)
Mutual labels:  sdk
Ali Mns
The nodejs sdk for aliyun mqs service
Stars: ✭ 107 (-2.73%)
Mutual labels:  sdk
Web3sdk
java sdk for FISCO BCOS
Stars: ✭ 108 (-1.82%)
Mutual labels:  sdk
Weixinsdk
Wlitsoft 框架 - 微信公众号开发工具包(C# 版)
Stars: ✭ 102 (-7.27%)
Mutual labels:  sdk
Swift Sdk
LeanCloud Swift SDK
Stars: ✭ 110 (+0%)
Mutual labels:  sdk
Python Scaleway
🐍 Python SDK to query Scaleway APIs.
Stars: ✭ 107 (-2.73%)
Mutual labels:  sdk
Open62541
Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
Stars: ✭ 1,643 (+1393.64%)
Mutual labels:  sdk
Onedrive Php Sdk
OneDrive SDK for PHP
Stars: ✭ 104 (-5.45%)
Mutual labels:  sdk
Redtamarin
AS3 running on the command line / server side
Stars: ✭ 105 (-4.55%)
Mutual labels:  sdk
Iot Sdk C
device sdk for baidu IoT Core service, in c. Including MQTT client
Stars: ✭ 108 (-1.82%)
Mutual labels:  sdk
Flickr Sdk
Almost certainly the best Flickr API client in the world for node and the browser
Stars: ✭ 104 (-5.45%)
Mutual labels:  sdk
Flow Go Sdk
Tools for building Go applications on Flow 🌊
Stars: ✭ 109 (-0.91%)
Mutual labels:  sdk
Go Sdk
A composable toolbox of libraries to build everything from CLIs to enterprise applications.
Stars: ✭ 103 (-6.36%)
Mutual labels:  sdk
Jd Union Sdk
京东联盟SDK,支持swoole和fpm两种模式
Stars: ✭ 108 (-1.82%)
Mutual labels:  sdk
Botframework Emulator
A desktop application that allows users to locally test and debug chat bots built with the Bot Framework SDK.
Stars: ✭ 1,532 (+1292.73%)
Mutual labels:  sdk
Qcloud Iot Sdk Embedded C
SDK for connecting to Tencent Cloud IoT from a device using embedded C.
Stars: ✭ 109 (-0.91%)
Mutual labels:  sdk
Docusign Node Client
The Official DocuSign Node.js Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
Stars: ✭ 108 (-1.82%)
Mutual labels:  sdk

Couchbase Ruby Client

license gem commits tests linters jenkins

This repository contains the third generation of the official Couchbase SDK for Ruby (aka. SDKv3)

Support and Feedback

If you find an issue, please file it in our JIRA issue tracker. Also you are always welcome on our forum.

Please attach version information to ticket/post. To obtain this information use the following command:

$ ruby -r couchbase -e 'p Couchbase::VERSION'

Installation

The library tested with the MRI 2.5, 2.6, 2.7 and 3.0. Supported platforms are Linux and MacOS.

Add this line to your application's Gemfile:

gem "couchbase", "3.0.3"

And then execute:

$ bundle install

Or install it yourself as:

$ gem install couchbase

For some platforms we precompile binary packages. When, for some reason, binary package cannot be used, pass --platform=ruby to gem install command (or check specific_platform and force_ruby_platform options of Bundler). In latter case, see Development section for build dependencies.

Usage

Here is a basic steps demonstrating basic operations with data:

require "couchbase"
include Couchbase # include Couchbase module for brevity

# initialize library
cluster = Cluster.connect("couchbase://127.0.0.1", "Administrator", "password")

# open bucket and collection for data operations
bucket = cluster.bucket("my_bucket")
collection = bucket.default_collection

# update or insert the document
res = collection.upsert("foo", {"bar" => 42})
res.cas
#=> 22120998714646

# retrieve document from the collection
res = collection.get("foo")
res.cas
#=> 22120998714646
res.content
#=> {"bar"=>42}

# remove document
res = collection.remove("foo")
res.cas
#=> 47891154812182

# fetch top-3 cities by number of hotels in the collection
res = cluster.query("
          SELECT city, COUNT(*) AS cnt FROM `travel-sample`
          WHERE type = $type
          GROUP BY city
          ORDER BY cnt DESC
          LIMIT 3",
        Options::Query(named_parameters: {type: "hotel"}, metrics: true))
res.rows.each do |row|
  p row
end
#=> {"city"=>"San Francisco", "cnt"=>132}
#   {"city"=>"London", "cnt"=>67}
#   {"city"=>"Paris", "cnt"=>64}

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

Part of the library is written in C++, and requires both C and C++ compilers installed on the system. To configure build environment, it uses cmake. When these tools installed, the build process is easy:

$ rake compile

Generate Documentation

To generate documentation yard library is highly recommended.

$ gem install yard

The following steps will generate API reference for selected git tag:

$ rake doc

Now the API reference is accessible using web browser (where VERSION is current version of the SDK)

$ firefox doc/couchbase-ruby-client-VERSION/index.html

License

The gem is available as open source under the terms of the Apache2 License.

Copyright 2011-2020 Couchbase, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].