Support wasm32-unknown-unknown target#1643
Conversation
wasm32-unknown-unknown target
|
I know nothing about wasm so we need to find someone kind enough to validate this PR. |
Of course, I will add the tests runner to CI/CD later today, currently all the tests pass (except a couple that require |
|
The tests have been added to the CI/CD (approval is required to verify whether they work). All tests have passed in local testing. |
|
Thanks for your time and explanations. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1643 +/- ##
==========================================
- Coverage 86.90% 82.08% -4.82%
==========================================
Files 58 58
Lines 10638 7398 -3240
==========================================
- Hits 9245 6073 -3172
+ Misses 1393 1325 -68 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Fixed CI for By the way, why does the CI process require approval? It seems that it is not convenient to find problems and fix CI. |
Maybe because a patched / malicious |
Reasonable. I need to rerun CI now to verify whether everything passes. Can you approve it? |
You can enable Actions on your fork and get CI to run inside your account instead of from the PR. |
Thanks! |
|
CI have passed: https://github.com/Spxg/rusqlite/actions/runs/13284078817/job/37088729090, cov failed because I didn’t have a token to upload. (thanks to @trevyn ) I'm ready for the review. |
|
Because of breaking changes, sqlite-wasm-rs is updated to 0.3
|
Any suggestions? |
|
This PR is exactly what I need for one of my projects, so I hope someone can validate it soon. I can at least confirm @Spxg 's fork works without issue when used as a dependency in a project targeting |
Currently, there is only one option for persistence: opfs-sahpool, which is ported from sqlite-wasm (https://sqlite.org/wasm/doc/trunk/persistence.md#vfs-opfs-sahpool) and needs to run on a dedicated worker. Other VFS are more difficult to implement, such as VFS based on IndexedDB, because they are asynchronous and require a lot of extra work: rhashimoto/wa-sqlite#154 (comment) For more usages, see https://github.com/Spxg/sqlite-wasm-rs/blob/master/VFS.md#opfs-sahpool. This interface is now re-exported by rusqlite, and can be installed using |
If you are interested, here is an example I wrote for diesel, which can easily experience the difference between memory vfs and persistent vfs: https://github.com/diesel-rs/diesel/tree/master/examples/sqlite/wasm. ( |
|
Precompiled products are not provided by default, you can specify the |
|
@Spxg Thanks for the information! |
|
It seems like they all don't have time to review it, so I thought of some questions you might be concerned about, I hope this can answer your questions.
|
|
Users can override features in their own Cargo.toml
|
@gwenn any suggestions? |
Yes, |
Which means the official sqlite3.wasm ? |
This means we can compile However, this is only one step, more work is actually to implement a persistent VFS under If you are interested, you can try it out at https://sqlight.dev |
Of course, another important work is to complete some C functions: |
|
Ok, thanks for the details. |
I don't know if it can be implemented this way.