Copyright (c) 2012-2013 Roman Tsisyk
Authors: Roman Tsisyk (roman@tsisyk.com
).
References
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
Early alpha. INSERT, SELECT, REPLACE and CALL is fully supported. UPDATE is not implemented. Request multiplexing is supported.
Please use 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"}}},
]}.
%% 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
etarantool |
etarantool_iproto |
etarantool_varint |