wasi-dbms-memory

WASI file-backed MemoryProvider implementation for the wasm-dbms framework.
This crate provides WasiMemoryProvider, a persistent storage backend
that uses a single flat file on the filesystem, enabling wasm-dbms to run
on any WASI-compliant runtime (Wasmer, Wasmtime, WasmEdge, etc.) with durable
data persistence.
Components
WasiMemoryProvider- File-backedMemoryProviderfor WASI runtimes
How It Works
The backing file is byte-for-byte equivalent to IC stable memory: a contiguous
sequence of 64 KiB pages, zero-filled on allocation. This means database
snapshots are portable across different MemoryProvider implementations.
new(path)opens or creates the file. Existing files have their page count inferred from file size. Non-page-aligned files are rejected.grow(n)extends the file byn * 64 KiBzero-filled bytes.read/writeoperate at arbitrary byte offsets with bounds checking.
Usage
use WasiMemoryProvider;
use DbmsContext;
let provider = new.unwrap;
let ctx = new;
// use ctx with wasm-dbms as usual
License
This project is licensed under the MIT License. See the LICENSE file for details.