Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

ci: speed up rust checks

t8y284f83d4d4989
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 997c06e3d3..969a06083a 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -73,10 +73,7 @@ jobs:
run: cargo fmt --check
- name: Cargo clippy
- run: cargo clippy --workspace --locked
-
- - name: Cargo check
- run: cargo check --workspace --locked
+ run: cargo clippy --workspace --locked --all-targets
- name: Cargo test
run: cargo test --workspace --locked
diff --git a/crates/dbx-core/src/db/sqlite.rs b/crates/dbx-core/src/db/sqlite.rs
index 3cc2f672b3..3c0595f420 100644
--- a/crates/dbx-core/src/db/sqlite.rs
+++ b/crates/dbx-core/src/db/sqlite.rs
@@ -297,7 +297,7 @@ mod tests {
assert_eq!(result.rows[0][2].as_f64(), Some(0.0));
assert_eq!(result.rows[0][3].as_f64(), Some(2.0));
let pi = result.rows[0][4].as_f64().expect("PI() returns a real value");
- assert!((3.14..3.15).contains(&pi));
+ assert!((std::f64::consts::PI - pi).abs() < 0.00001);
}
#[tokio::test]
diff --git a/crates/dbx-core/src/query.rs b/crates/dbx-core/src/query.rs
index 35ebfca3fb..d32c65bde6 100644
--- a/crates/dbx-core/src/query.rs
+++ b/crates/dbx-core/src/query.rs
@@ -1439,13 +1439,13 @@ mod tests {
let con = duckdb::Connection::open_in_memory().expect("connect in-memory DuckDB");
let result = duckdb_execute(
&con,
- "SELECT 3.14159::DOUBLE AS pi, 0.5::DOUBLE AS half, 99.99::DOUBLE AS price, 1.0::DOUBLE AS one",
+ "SELECT 12.34567::DOUBLE AS sample, 0.5::DOUBLE AS half, 99.99::DOUBLE AS price, 1.0::DOUBLE AS one",
)
.expect("execute double query");
- assert_eq!(result.columns, vec!["pi", "half", "price", "one"]);
+ assert_eq!(result.columns, vec!["sample", "half", "price", "one"]);
let row = &result.rows[0];
- assert_eq!(row[0], serde_json::json!(3.14159));
+ assert_eq!(row[0], serde_json::json!(12.34567));
assert_eq!(row[1], serde_json::json!(0.5));
assert_eq!(row[2], serde_json::json!(99.99));
assert_eq!(row[3], serde_json::json!(1.0));
diff --git a/crates/dbx-core/src/table_export.rs b/crates/dbx-core/src/table_export.rs
index c6b29a1e33..252d7c4962 100644
--- a/crates/dbx-core/src/table_export.rs
+++ b/crates/dbx-core/src/table_export.rs
@@ -308,9 +308,9 @@ mod tests {
#[test]
fn formats_csv_rows_with_boolean_and_number_values() {
- let rows = vec![vec![json!(true), json!(3.14)], vec![json!(false), json!(-42)]];
+ let rows = vec![vec![json!(true), json!(2.75)], vec![json!(false), json!(-42)]];
let out = format_csv_rows(&rows);
- assert!(csv_lines_equal(&out, "\"true\",\"3.14\"\n\"false\",\"-42\""));
+ assert!(csv_lines_equal(&out, "\"true\",\"2.75\"\n\"false\",\"-42\""));
}
#[test]