←back to thread

Sqlite3 WebAssembly

(sqlite.org)
506 points whatever3 | 3 comments | | HN request time: 0s | source
Show context
bhelx ◴[] No.41852085[source]
I used the wasm build of sqlite and the Chicory runtime to create a pure JVM executed sqlite library: https://github.com/dylibso/sqlite-zero

It's more of an experiment than an attempt to make something production ready, though I could see it being useful to bring dependency-less sqlite tooling to the JVM ecosystem.

replies(1): >>41853167 #
ncruces ◴[] No.41853167[source]
What's the file system access like, WASI?
replies(1): >>41853286 #
1. bhelx ◴[] No.41853286[source]
Chicory has some partial wasip1 support. https://github.com/dylibso/chicory/tree/main/wasi. We use jimfs to keep things simple and secure (and not worry about exposing the real filesystem): https://github.com/google/jimfs

When I did this experiment a few months ago, what we could accomplish was pretty limited. I could load and query databases, but not write to them. However the Chicory wasip1 implementation is advancing.

BTW, we've borrowed a few ideas from wazero so thanks for your work there :)

replies(1): >>41853465 #
2. ncruces ◴[] No.41853465[source]
If the goal is to improve Chicory WASI support, this is the way.

If the goal was pure Java SQLite¹, a VFS from scratch would be better.

I think since I started my Go/wazero effort, WASI+SQLite improved a bunch. I had to start with the demo VFS; the Unix VFS now builds. But custom VFS is still the way to go, IMO.

And thanks! My contributions to wazero were tiny. Best of luck with Chicory!

1: strong NestedVM vibes here; 11 years ago… gosh, I feel old now. https://stackoverflow.com/questions/18186507/pure-java-vs-na...

replies(1): >>41853521 #
3. bhelx ◴[] No.41853521[source]
> If the goal was pure Java SQLite¹, a VFS from scratch would be better.

agreed, though this was more an experiment to test Chicory once we built initial wasi support. I'd love to see it picked up and improved. I think that's the direction I'd go if i want some kind of production ready library.