wasmerio / wasmer

🚀 The leading Wasm Runtime supporting WASIX and WASI
https://wasmer.io
MIT License
19.04k stars 814 forks source link

Failed to run sqlite with specified database file #5246

Closed lianzhilu closed 1 day ago

lianzhilu commented 1 week ago

I get sqlite.wasm by compiling files from wapm-sqlite.

Then, I try to run sqlite on wasmer with a specified database file, and my command is

wasmer run sqlite.wasm /path/to/db/chinook.db

After entering the sqlite interface, I try to figure out the current database sqlite uses:

sqlite> .database

and it turns out:

Error: unable to open database "/path/to/db/chinook.db": unable to open database file

I've try other commands like:

wasmer run sqlite.wasm --dir=/path/to/db/ chinook.db
wasmer run sqlite.wasm --dir=/path/to/db/  /path/to/db/chinook.db

but they dont work.

theduke commented 1 week ago

That's a very ancient build.

Things work when you do this:

wasmer run --mapdir /data:$(pwd) sqlite/sqlite --entrypoint sqlite3 -- /data/db.sqlite3
xdoardo commented 1 day ago

@lianzhilu I will close this issue. If you have any other problem feel free to reopen it or reach out to us on discord.