Feature: SQLite-for-WASM support#3994
Draft
unhighghlow wants to merge 15 commits intolaunchbadge:mainfrom
Draft
Conversation
Contributor
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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