-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Feature: SQLite-for-WASM support #3994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
I've been attempting to test this PR out. It believe its crashing when unwrapping the call to The error is: I believe it may be due to the use of a thread in It's possible |
This change
adds a new featureDetects when the target is WASM, which, when enabled, replacessqlite-wasmlibsqlite3-syswithsqlite-wasm-rs.It is a new database driver (in the sense that thesqlite-wasmfeature should replace thesqlitefeature, unlikesqlite-unbundled)But it is also not new, since no new APIs were created
Does your PR solve an issue?
fixes #2985
Is this a breaking change?
No, as the new database driver:sqlite-wasmis only activated with the new feature, and without it, no dependencies or APIs are changed. (Except for the fact that some versions inCargo.lockwere modified, which I have no idea how to stop)Edit: it now uses
sqlite-wasm-rswhen the target iswasm. This changes the behavior of compiling sqlx with sqlite on WASM from "compilation error" to "success". I don't think this is a breaking changeProblem 1
SQLite-WASM does not support
load-extension, which is included in the default configuration for sqlite. There are multiple ways to solve this:sqlite-load-extensioncause a build error on WASM, but keep it turned on by defaultsqlite-wasm, which decreases the inconveniencesqlite-load-extensioncause a build error on WASM and remove it from the defaultssqlite-load-extensioncause a build error on WASM, but only when explicitly chosen, with the default being silently ignoredProblem 2
The sqlite version used for compile-time checking (the system one) is different from the sqlite version used at runtime (WASM). This isn't actually a big problem, because the same already happens when using
sqlite-unbundledTodo
sqlite-wasm-rsandlibsqlite3-sysare identical (to be fair I don't really know)Oh no
sqlite-wasm-rsfeatures