Repository navigation
Tauri: Bind boolean parameters as integers - #1143
Merged
Merged
Conversation
SQLite has no boolean type. The web SDK (wa-sqlite) binds true/false as 1/0, but the Tauri plugin rejected boolean parameters, so queries that work with @powersync/web fail after switching to @powersync/tauri-plugin. Add visit_bool to the SqliteValue deserializer, a test mirroring 'can bind integers', and a changeset.
redundant_pattern_matching and explicit_auto_deref; no behavior change.
🦋 Changeset detectedLatest commit: 81c58a5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Simon Binder <oss@simonbinder.eu>
simolus3
approved these changes
Oct 8, 2026
simolus3
left a comment
Contributor
There was a problem hiding this comment.
LGTM, I also ran tests locally.
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.
Binding a JavaScript boolean as a query parameter currently fails with the Tauri plugin, because the
SqliteValuedeserializer incommands.rshas novisit_bool. The same call works with@powersync/web: wa-sqlite bindstrue/falseas1/0(sqlite-api.js). SQLite has no boolean type, so1/0is the usual representation.We ran into this when moving a production desktop app from
@powersync/webto@powersync/tauri-plugin(WebKitGTK's WASM memory growth made the web SDK unusable for us on Linux). Queries that bound booleans started failing after the switch, and we've been running with this change in a local copy of the plugin since.This PR:
visit_boolto theSqliteValuedeserializer, mappingtrue/falsetoSqliteValue::Integer(1)/SqliteValue::Integer(0), the same way Tauri: Fix binding integer values, emit events on main thread #965 handled integers parsed asu64. Theexpectingmessage now lists booleans too.can bind booleansintegration test next tocan bind integers.@powersync/tauri-plugin.A second, separate commit fixes three clippy lints in
commands.rs(redundant_pattern_matching,explicit_auto_deref) socargo clippy --all-targets -- -D warningspasses. It doesn't change behavior; happy to drop it if you'd rather keep this PR to the fix.Testing:
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testpass forpackages/tauri. I haven't run the Tauri integration suite (pnpm testwith the test runner) locally, and that step is currently disabled in CI, so the new test hasn't been executed yet.Side note, not changed here:
packages/tauri/Cargo.tomlusesrust = "1.77", which Cargo ignores with an "unused manifest key" warning. The key Cargo reads isrust-version.