←back to thread

Sqlite3 WebAssembly

(sqlite.org)
506 points whatever3 | 1 comments | | HN request time: 0s | source
Show context
TiredGuy ◴[] No.41851263[source]
So after downloading from the official downloads page and stripping away all the mjs files and "bundler-friendly" files, a minimal sqlite wasm dependency will be about 1.3MB.

For an in-browser app, that seems a bit much but of course wasm runs in other places these days where it might make more sense.

replies(8): >>41851337 #>>41851618 #>>41851622 #>>41851724 #>>41851840 #>>41852258 #>>41854092 #>>41855860 #
hawski ◴[] No.41852258[source]
Is there a way to statically compile an application with SQLite and the result WASM was smaller. So for example I have an app that would use only a specific subset of SQLite. Could the SQLite's WASM be built with this in mind cutting down on code that is not used? Or is there a way to prune it having the used API surface?

In a regular compiler/linker scenario it would just be a static compilation. Here we have a JS app and WASM library.

replies(2): >>41852312 #>>41854865 #
1. hoten ◴[] No.41852312[source]
Since SQL takes arbitrary strings as input, this would require explicit compiler flags to disable the knobs you don't want. Can't rely on excluding unused symbols really.