←back to thread

Sqlite3 WebAssembly

(sqlite.org)
647 points whatever3 | 1 comments | | HN request time: 0s | source
Show context
koolala ◴[] No.41854598[source]
The CORS restrictions / needing SharedArrayBuffer support kinda stinks.

There is no way to use Sqlite3 off-thread without memory sharing? Couldn't postMessage work to pass data to the sqlite thread by using the third Transfer argument?

Would postMessage transfer allow memory to be stored in a sqlite wasm database running a worker off-thread?

Refering to this implementation's docs: https://github.com/sqlite/sqlite-wasm

replies(1): >>41854755 #
sgbeal ◴[] No.41854755[source]
> The CORS restrictions / needing SharedArrayBuffer support kinda stinks.

We have no CORS restrictions but one specific (and optional) VFS requires COOP/COEP for SharedArrayBuffer. If SharedArrayBuffer isn't available, that VFS won't load, but the rest of the library will plod along just fine:

https://sqlite.org/wasm/doc/tip/persistence.md

replies(1): >>41860315 #
koolala ◴[] No.41860315[source]
Persistence is the whole point to me for a Database. OPFS finally adding a filesystem to the browser made seem like the web file database situation could finally standardize but COOP/COEP ruins it.
replies(2): >>41861111 #>>41869339 #