An open API service indexing awesome lists of open source software.

https://github.com/tarantool/tarantool-erlang

An Erlang client for Tarantool (supported by the community)
https://github.com/tarantool/tarantool-erlang

Last synced: about 1 year ago
JSON representation

An Erlang client for Tarantool (supported by the community)

Awesome Lists containing this project

README

          

# Erlang connector to 1.5 #

Copyright (c) 2012-2013 Roman Tsisyk

__Authors:__ Roman Tsisyk ([`roman@tsisyk.com`](mailto:roman@tsisyk.com)).

__References__
* [Tarantool homepage](http://tarantool.org/)
* [Tarantool IPROTO protocol reference](https://github.com/tarantool/tarantool/blob/1.5.5/doc/box-protocol.txt)

### Overview ###

ETarantool is an Erlang client for Tarantool NoSQL database.

Tarantool is an efficient in-memory data store.
This library uses Tarantool's binary request/response protocol, called IPROTO.
IPROTO features a complete access to Tarantool functionality, including:
* request multiplexing, e.g. ability to asynchronously issue multiple
requests via the same connection
* response format that supports zero-copy writes

### Status ###

Early alpha. INSERT, SELECT, REPLACE and CALL is fully supported.
UPDATE is not implemented. Request multiplexing is supported.

### Installation ###

Please use [rebar](https://github.com/basho/rebar).
The following lines are needed in your `rebar.config` in order to get this work:

```
{lib_dirs,["deps"]}.
{deps, [
{'etarantool', ".*", {git, "git://github.com/rtsisyk/etarantool.git",
{branch, "master"}}},
]}.
```

### Examples ###

```
%% Connect
> {ok, Conn} = etarantool:connect("localhost").
{ok,<0.55.0>}

%% Insert
> {ok, Tuples} = etarantool:insert(Conn, 0, [{1, 2, "text"}], [return_tuple]).
{ok,[[<<1,0,0,0>>,<<2,0,0,0>>,<<"text">>]]}

%% Select
> {ok, Tuples} = etarantool:select(Conn, 0, 0, [{1}]).
{ok,[[<<1,0,0,0>>,<<2,0,0,0>>,<<"text">>]]}

%% Call
> {ok, Tuples} = etarantool:call(Conn, <<"box.select">>, [0, 0, 1]).
{ok,[[<<1,0,0,0>>,<<2,0,0,0>>,<<"text">>]]}

%% Delete
> {ok, Tuples} = etarantool:delete(Conn, 0, [{1}], [return_tuple]).
{ok,[[<<1,0,0,0>>,<<2,0,0,0>>,<<"text">>]]}

%% Close
> ok = etarantool:close(Conn).
ok
```

## Modules ##

etarantool
etarantool_iproto
etarantool_varint