fix: bind edited PG cell values via text wire format
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user