Skip to content

Commit 75f69bf

Browse files
authored
docs: mention WasmEdge backend (#134)
A short paragraph mentions multiple Wasm configurations and explains the quirks of the new WasmEdge backend.
1 parent 91451c5 commit 75f69bf

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

doc/libsql_extensions.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ You can also download a pre-compiled binary from https://github.com/libsql/libsq
6262
docker run -it piotrsarna/libsql:libsql-0.1.0-wasm-udf ./libsql
6363
```
6464

65+
#### Configurations
66+
67+
WebAssembly runtime can be enabled in multiple configurations:
68+
1. Based on [Wasmtime](https://wasmtime.dev/), linked statically (default)
69+
```sh
70+
./configure --enable-wasm-runtime
71+
```
72+
2. Based on [Wasmtime](https://wasmtime.dev/), linked dynamically
73+
```sh
74+
./configure --enable-wasm-runtime-dynamic
75+
```
76+
3. Based on [WasmEdge](https://wasmedge.org/), linked dynamically with `libwasmedge`
77+
```sh
78+
./configure --enable-wasm-runtime-wasmedge
79+
```
80+
> **NOTE:** WasmEdge backend comes without the ability to translate WebAssembly text format (WAT) to Wasm binary format. In this configuration, user-defined functions can only be defined with their source code passed as a compiled binary blob. In [libSQL bindgen](https://bindgen.libsql.org) you can produce it by checking the "as a binary blob" checkbox.
81+
> **NOTE2:** WasmEdge backend depends on `libwasmedge` compatible with their 0.11.2 release. If your package manager does not have it available, download it from the official [release page](https://github.com/WasmEdge/WasmEdge/releases).
82+
83+
If you're interested in a setup that links `libwasmedge.a` statically, let us know, or, better yet, send a patch!
84+
6585
#### shell support
6686
In order to initialize the internal WebAssembly function lookup table in libsql shell (sqlite3 binary), one can use the `.init_wasm_func_table` command. This command is safe to be called multiple times, even if the internal table already exists.
6787

0 commit comments

Comments
 (0)