fix: resolve PostgreSQL/MySQL/SQL Server NUMERIC/DECIMAL display issues
- Add rust_decimal feature to sqlx and tiberius for proper Decimal type handling - Fix try_get_unchecked<String> causing NULL or garbled output for numeric types - Add numeric_precision and numeric_scale to ColumnInfo for all database drivers - Update frontend to display precision (e.g., numeric(20,6)) in column headers - Fix typeColorClass to handle type names with precision suffix Root cause: PostgreSQL binary protocol sends NUMERIC as PgNumeric binary format, not UTF-8 text. try_get_unchecked<String> attempted to decode binary bytes as UTF-8, causing decode failures (NULL) or garbage characters (乱码).
This commit is contained in:
13 files changed
+62
-20
No files matched your search
@@ -49,6 +49,8 @@ fn duckdb_query_columns(con: &duckdb::Connection, table: &str) -> Result<Vec<db:
|
||||
is_nullable: row.get::<_, String>(2).unwrap_or_default() == "YES",
|
||||
column_default: row.get::<_, Option<String>>(3)?,
|
||||
extra: None, comment: None,
|
||||
numeric_precision: None,
|
||||
numeric_scale: None,
|
||||
})
|
||||
}).map_err(|e| e.to_string())?;
|
||||
Ok(rows.filter_map(|r| r.ok()).collect())
|
||||
|
||||
Reference in new issue
Block a user