erlang使用leveldb

用的是诺顿的开源库,参考url来自这里

 

下载

git clone git@github.com:/norton/lets.git

 

编译

cd lets
./rebar get-deps
./rebar compile
cd ebin
erl -pa ../deps/*/ebin

 

测试

application:start(sasl).
application:start(lets).

OptsDB = [{path, "mytable"}, create_if_missing],
lets:new(mytable, [named_table, compressed, {db, OptsDB}]).
lets:insert(mytable, {"hi", "hello"}).
lets:insert(mytable, {"bye", "goodbye"}).
lets:lookup(mytable, "hi").

 

posted @ 2015-10-09 23:27  自由出土文物  阅读(233)  评论(0编辑  收藏  举报