Coder Social home page Coder Social logo

couchie's Introduction

#Couchie

Couchie is a minimalist API for accessing Couchbase 2.0 servers from within elixir. It should work for elrangers as well, as elixir code can be called from erlang (since it runs on the erlang vm.)

Status: CRUD Working, Simple Views Supported.

  • Tagged version supports R17.0 & Elixir 0.13.0
  • Master requires Elixir 0.15ish and R17ish

Description

Couchie uses cberl (libcouchbase as a NIF) for database access and Jazz to turn the JSON documents that Couchbase returns into Elixir Maps.

Couchie has recently become "opinionated" in that it expects you to be storing maps (though any structure that Jazz's encoders can handle should work.) Decoding has the atoms keys set, so that the keys in the maps you get back will be atoms.

Building

Note: to build, you need to have libcouchbase installed.

brew install libcouchbase

Example


	$ iex -S mix
	Erlang R16B (erts-5.10.1) [source-05f1189] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]

	Interactive Elixir (0.8.1) - press Ctrl+C to exit (type h() ENTER for help)
	iex(1)> Couchie.open(:d)
	Opening d, 10, localhost:8091
	Opening d, 10, localhost:8091, , ,  
	Opened d, 10, localhost:8091
	:ok
	iex(2)> Couchie.set(:d, "foo", %{foo: "bar"})
	:ok
	iex(3)> Couchie.get(:d, "foo")
	{"foo", 10812679138524069888, %{foo: "bar"}}
	iex(4)>

Simple support for cberl views"

Couchie.open(:beer, 10, 'cb.server.w.beer.sample:8091', 'beer-sample', 'beer-sample', '')
Couchie.query(:beer, 'beer', 'brewery_beers', [{:limit, 10}])

##Current functionality

  • Basic commands: Set, Get, MGet, Delete
  • named connections.
  • Support multiple buckets open simultaneously
  • Support raw and json encoding of data

##Planned functionality

  • Simple translation from the Couchbase View's REST API to elixir functions, allowing complex queries to be supported.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.