sqlite / sqlite-wasm

SQLite Wasm conveniently wrapped as an ES Module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prepared statements with wrapped worker

marcus-pousette opened this issue · comments

Is it possible to prepare statement when using the API from the wrapped worker? It seems only possible now to perform raw statements. If not, would love to have this feature!

Is it possible to prepare statement when using the API from the wrapped worker?

If you mean with the worker1 API then no, that's not possible, because the controlling thread has no direct access to the sqlite API, which is loaded and running in its own separate thread. The sqlite-related resources are tied specifically to the thread they are loaded in and cannot be shared by any two threads. Only data which can pass through postMessage() can be shared across threads.