25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
chore: format rust sources
t8y2ad7db2cb494d
diff --git a/crates/dbx-core/src/db/mysql.rs b/crates/dbx-core/src/db/mysql.rsindex 39ca7ce1e3..568267b4ca 100644--- a/crates/dbx-core/src/db/mysql.rs+++ b/crates/dbx-core/src/db/mysql.rs@@ -143,9 +143,7 @@ fn mysql_value_to_json(row: &mysql_async::Row, idx: usize) -> serde_json::Value}).or_else(|| row_get::<i64, _>(row, idx).map(|v| serde_json::Value::String(v.to_string()))).or_else(|| row_get::<u64, _>(row, idx).map(|v| serde_json::Value::String(v.to_string())))- .or_else(|| {- row_get::<Vec<u8>, _>(row, idx).map(|bytes| mysql_bytes_to_json(bytes, column))- })+ .or_else(|| row_get::<Vec<u8>, _>(row, idx).map(|bytes| mysql_bytes_to_json(bytes, column))).unwrap_or(serde_json::Value::Null);}return row@@ -204,9 +202,7 @@ fn mysql_value_to_json(row: &mysql_async::Row, idx: usize) -> serde_json::Value})}).or_else(|| row_get::<bool, _>(row, idx).map(serde_json::Value::Bool))- .or_else(|| {- row_get::<Vec<u8>, _>(row, idx).map(|bytes| mysql_bytes_to_json(bytes, column))- })+ .or_else(|| row_get::<Vec<u8>, _>(row, idx).map(|bytes| mysql_bytes_to_json(bytes, column))).unwrap_or(serde_json::Value::Null)}diff --git a/crates/dbx-core/src/db/postgres.rs b/crates/dbx-core/src/db/postgres.rsindex 1805c832db..1023ab016c 100644--- a/crates/dbx-core/src/db/postgres.rs+++ b/crates/dbx-core/src/db/postgres.rs@@ -201,9 +201,7 @@ fn pg_value_to_json(row: &Row, idx: usize, type_name: &str) -> serde_json::Value.or_else(|_| row.try_get::<_, bool>(idx).map(serde_json::Value::Bool)).or_else(|_| row.try_get::<_, uuid::Uuid>(idx).map(|v| serde_json::Value::String(v.to_string()))).or_else(|e| pg_temporal_to_json_value(row, idx).ok_or(e))- .or_else(|_| {- row.try_get::<_, Vec<u8>>(idx).map(|bytes| super::binary_value_to_json(&bytes))- })+ .or_else(|_| row.try_get::<_, Vec<u8>>(idx).map(|bytes| super::binary_value_to_json(&bytes))).unwrap_or(serde_json::Value::Null)}diff --git a/crates/dbx-core/src/query_result_sql.rs b/crates/dbx-core/src/query_result_sql.rsindex d59a9e9da3..6ec973bd87 100644--- a/crates/dbx-core/src/query_result_sql.rs+++ b/crates/dbx-core/src/query_result_sql.rs@@ -361,11 +361,7 @@ fn add_fetch_first_limit(statement: &str, limit: usize, offset: usize) -> Stringif has_top_level_fetch_first(statement) {return format!("{statement};");}- let offset_sql = if offset > 0 {- format!(" OFFSET {offset} ROWS")- } else {- String::new()- };+ let offset_sql = if offset > 0 { format!(" OFFSET {offset} ROWS") } else { String::new() };format!("{statement}{offset_sql} FETCH FIRST {limit} ROWS ONLY;")}@@ -373,11 +369,7 @@ fn add_standard_limit(statement: &str, limit: usize, offset: usize) -> String {if has_top_level_limit(statement) {return format!("{statement};");}- let offset_sql = if offset > 0 {- format!(" OFFSET {offset}")- } else {- String::new()- };+ let offset_sql = if offset > 0 { format!(" OFFSET {offset}") } else { String::new() };format!("{statement} LIMIT {limit}{offset_sql};")}@@ -599,10 +591,7 @@ mod tests {});assert_eq!(result.ok, true);- assert_eq!(- result.sql.unwrap(),- "SELECT id, name FROM users LIMIT 100 OFFSET 200;"- );+ assert_eq!(result.sql.unwrap(), "SELECT id, name FROM users LIMIT 100 OFFSET 200;");}#[test]@@ -678,10 +667,7 @@ mod tests {offset: 0,});- assert_eq!(- result.sql.unwrap(),- "SELECT id FROM users FETCH FIRST 100 ROWS ONLY;"- );+ assert_eq!(result.sql.unwrap(), "SELECT id FROM users FETCH FIRST 100 ROWS ONLY;");}#[test]