fold_options() = [{start_key, key()} | {end_key, key()} | {gt, key()} | {gte, key()} | {lt, key()} | {lte, key()} | {max, integer()} | {fill_cache, true | false}]
key() = term()
keys() = [key()]
value() = term()
clear/2 | delete the value associated to the key. |
clear_range/4 | delete all K/Vs in a range. |
close/1 | close a storage. |
contains/2 | is the key exists in the storage. |
destroy/1 | close a storage and remove all the data. |
fold/4 | fold all K/Vs with a function
Additionnaly you can pass the following options:
|
fold_keys/4 | fold all keys with a function same parameters as in the fold function. |
get/2 | get the value associated to the key. |
is_empty/1 | Returns true if this backend contains any values; otherwise returns false. |
open/2 | open a storage, amd pass options to the backend. |
put/3 | store the value associated to the key. |
scan/4 | retrieve a list of Key/Value in a range. |
write_batch/2 | do multiple operations on the backend. |
delete the value associated to the key
close(Engine::engine()) -> ok | {error, any()}
is the key exists in the storage
destroy(Engine::engine()) -> ok | {error, any()}
close a storage and remove all the data
fold(Engine::engine(), Fun::function(), Acc0::any(), Opts::fold_options()) -> any() | {error, term()}
fold all K/Vs with a function Additionnaly you can pass the following options:
-
'gt', (greater than), 'gte' (greather than or equal): define the lower bound of the range to fold. Only the records where the key is greater (or equal to) will be given to the function.
-
'lt' (less than), 'lte' (less than or equal): define the higher bound of the range to fold. Only the records where the key is less than (or equal to) will be given to the function
-
'start_key', 'end_key', legacy to 'gte', 'lte'
-
'max' (default=0), the maximum of records to fold before returning the resut
-
'fill_cache' (default is true): should be the data cached in memory?
fold_keys(Engine::engine(), Fun::function(), Acc0::any(), Opts::fold_options()) -> any() | {error, term()}
fold all keys with a function same parameters as in the fold function.
get the value associated to the key
is_empty(Engine::engine()) -> boolean() | {error, term()}
Returns true if this backend contains any values; otherwise returns false.
open(Name::binary(), Options::list()) -> {ok, engine()} | {error, any()}
open a storage, amd pass options to the backend. The following optinos can be used:
-
'backend': default is rkvs_ets, folowin backend are provided in rkvs: rkvs_ets, rkvs_leveldb, rkvs_rocksdb, rkvs_hanoidb, rvs_bitcask.
-
'db_opts': backend options, refers to the backend doc for them
-
'key_encoding': to encode the key. defautl is raw (binary). can be term, {term, Opts} or sext
-
'value_encoding': to encode the value. defautl is term. can be term, {term, Opts} or sext
store the value associated to the key.
retrieve a list of Key/Value in a range
do multiple operations on the backend.