fix: bind edited PG cell values via text wire format
Release / windows (push) Failing after 18m23s
Release / linux (push) Canceled after 22m17s

The frontend commits edited cell values as plain strings (and PK locators as
numbers/booleans), but tokio-postgres' String binds only text-ish types and
i64 only int8, so editing integer/boolean/uuid/jsonb/… columns failed with
'cannot convert between the Rust type and the Postgres type'.

Introduce PgText — a ToSql impl that accepts any Postgres type and writes the
value as UTF-8 in text wire format so the server parses it into the column's
own type. NULL binds as SQL NULL. Adds the bytes crate and unit tests.
This commit is contained in:
2026-09-01 05:17:47 +08:00
parent f8321d926f
commit 46e0dc2cee
3 changed files with 143 additions and 18 deletions
+1
View File
@@ -31,6 +31,7 @@ tauri-plugin-dialog = "2"
tauri-plugin-fs = "2"
tokio = { version = "1", features = ["full"] }
tokio-postgres = { version = "0.7", features = ["with-chrono-0_4", "with-uuid-1", "with-serde_json-1"] }
bytes = "1"
sqlx = { version = "0.8", features = ["runtime-tokio", "mysql", "tls-rustls", "json"] }
redis = { version = "0.27", features = ["tokio-comp"] }
# async-ssh2 is not available at v0.4; using synchronous ssh2 via tokio::task::spawn_blocking per plan's fallback