Compile sqlx (sqlite) for wasm32 #1886
nicolas-albert
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
Has anyone tried to get this working with any success? I think there is a lot of potential for wasm on the edge and a connection to something like https://chiselstrike.com/ |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I discovered your crate and it seems well designed.
I'm thinking about a data abstraction library over SQL that could run in an application written in Rust, in Java (JNI) but also in Web (compiled to WASM and store data in a local client database, like sqlite).
I haven't tested the compilation in JNI but I don't worry.
--target wasm32-unknown-unknown
compilation fails due to runtime (tokio or async-std).Other runtime dependent crate are wasm32 compatible, such as reqwest.
Then I tried to compile the crate sqlite and this time, it's an error specific to sqlite that does not pass (no
<pthread.h>
).In the end, I tried to compile the crate rusqlite successfully. They managed to modify their project to compile in wasm32.
I could use rusqlite for the wasm version and sqlx for the others (and benefit from all connectors) but it could be more clean to only use the sqlx api.
There remains the persistence of sqlite in a local database. The sqlite ports in wasm (not using Rust) use memory storage.
Except absrude-sql and wa-sqlite which allow an implementation of VFS on IndexedDB with performances that seem very correct.
It looks like a big project with several problems to solve that have been solved elsewhere:
sqlx seems really complete and the support of these technologies could open new development horizons.
Beta Was this translation helpful? Give feedback.
All reactions