The DuckDB engine compiled to a WebAssembly Component (wasm32-wasip2),
packaged as the reusable core that consumers embed — without pulling in the
rest of ducklink.
core(duckdb-component-core) — wrapslibduckdb-sysand exports theduckdb:component/libduckdbworld; compiles toducklink_core.wasm. Its WIT contract (including theduckdb:extensionimport surface and thetvm:memoryspill interface) is self-contained undercore/wit.libduckdb-sys— DuckDB's C/C++ amalgamation built for wasm.
Requires cargo component, the wasm32-wasip2 Rust target, and four build
inputs (wasi-sdk 33.0+, the prebuilt libduckdb-wasi.a, the DuckDB headers, and
the DuckDB wasm CMake build dir). scripts/setup-env.sh wires them, defaulting
to the sibling ducklink checkout's prebuilt artifacts (override any var to go
standalone):
make core # standalone/server core (wasi feature)
make core-browser # browser core (no fs shims)
make env # print the resolved inputs (+ whether each exists)Equivalently, by hand:
source scripts/setup-env.sh
cargo component build -p duckdb-component-core --target wasm32-wasip2 --release --features wasiThe compiled component is target/wasm32-wasip2/release/ducklink_core.wasm.
To rebuild libduckdb-wasi.a itself from DuckDB source (needs wasi-sdk), use
./scripts/build-libduckdb-wasm.sh; ./scripts/sync-core-wit.sh regenerates
core/wit from a canonical wit/.
ducklink (host, CLI, extension
ecosystem) depends on this repo by path (../duckdb-wasm): its host bindgens
against core/wit and loads the compiled ducklink_core.wasm at runtime.