Open Half-Shot opened 3 days ago
I guess this would require the use of Sqlite's support for wasm. Not sure what would be involved in wiring that up.
I don't think we should use Sqlite compiled as Wasm. Instead, we should expose SQLite API via Wasm imports, and use SQLite compiled as a NodeJS bindings from C. It would be probably much faster and easier.
Instead, we should expose SQLite API via Wasm imports
You mean, build our own wrapper around the sqlite API, and somehow thread that through to the rust layer? That sounds like a lot of work.
It's probably a lot of work because the Matrix Rust SDK expects rusqlite API entirely. I wonder how it compiles to wasm32-unknown-unknown
and how linking is done. We should try.
It's probably more work than maintaining matrix-rust-sdk-crypto-nodejs
if you ask me 😛.
As part of my quest to look at moving the bots and bridges away from the nodejs binding layer, I'd like to talk about potentially enabling SQLite support for this binding layer. In the NodeJS project, we do https://github.com/matrix-org/matrix-rust-sdk-crypto-nodejs/blob/main/src/machine.rs#L113-L155.