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)
- Host: GitHub
- URL: https://github.com/tarantool/tarantool-erlang
- Owner: tarantool
- Created: 2012-11-11T21:38:21.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2020-12-19T15:51:00.000Z (over 5 years ago)
- Last Synced: 2025-04-14T15:13:09.186Z (about 1 year ago)
- Language: Erlang
- Homepage: http://tarantool.org/
- Size: 20.5 KB
- Stars: 9
- Watchers: 32
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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 ##