dreyk / etsdb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

etsdb_object:make_kv() not working as expected

mtourne opened this issue · comments

From what I gathered in the "doc", this is supposed to be the entry point if one were to use etsdb as a library.

However, this call will fail :
etsdb_object:make_kv(etsdb_tkb, {{foo, now_in_milliseconds()}, <<0.0/float>>}, round(now_in_milliseconds())).

The problem appears to be etsdb_tkb:serialize(Data, ForBackEnd) returning a list instead of a tuple as expected here :

    {UserKey,UserData} = Bucket:serialize(UserObject),```

To use it

  1. Implement bucket behaviour (while it seems buggy(#5) you can use etsdb_tkb) as an example
  2. Use etsdb_put, etsdb_scan to write and read data

Or you can use etsdb_tkb with etsdb_put & etsdb_scan

etsdb_put:put(etsdb_tkb,[{{k,I},<<I/integer>>}||I<-lists:seq(1,1000)]).
etsdb_scan:scan(etsdb_tkb:read_spec(k,0,1000),6000)

ps. maybe this should make it into the readme ?