Packages

redb, the embedded key-value store, running inside WebAssembly

Current section

Files

Jump to
wasm_redb README.md
Raw

README.md

# wasm_redb

redb 5.0.0, the embedded transactional key-value store, running inside a
WebAssembly guest on erlang_wasm, with no NIF. Named tables of binary keys
and values in key order, atomic transactions across tables, snapshot reads,
range scans. The guest is prebuilt in `priv/wasm_redb.wasm`; `priv/BUILD-INFO`
says what it was built from.

```erlang
{ok, Db} = wasm_redb:open(#{storage => {wasm_storage_file, "data.redb"}}),
ok = wasm_redb:put(Db, <<"docs">>, <<"key">>, <<"value">>),
{ok, <<"value">>} = wasm_redb:get(Db, <<"docs">>, <<"key">>).
```

It is much slower than native redb. Before you depend on it, read
[the redb guide](https://github.com/benoitc/wasm_storage/blob/main/docs/redb.md), [what an error means](https://github.com/benoitc/wasm_storage/blob/main/docs/failures.md)
and [the project's status](https://github.com/benoitc/wasm_storage/blob/main/docs/status.md).