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。

style(agent-runtime): 格式化运行时风险辅助函数

Illuminated2020dd3894df68c1
diff --git a/src-tauri/src/commands/agent_runtime.rs b/src-tauri/src/commands/agent_runtime.rs
index 0e1a284da4..6ca16883ce 100644
--- a/src-tauri/src/commands/agent_runtime.rs
+++ b/src-tauri/src/commands/agent_runtime.rs
@@ -398,7 +398,10 @@ async fn load_handoff_connection(app_state: Option<&AppState>, connection_id: &s
}
}
-fn matching_snapshot_connection_name<'a>(item: &HandoffItem, snapshot: &'a AgentRuntimeSnapshot) -> Option<&'a str> {
+fn matching_snapshot_connection_name<'a>(
+ item: &HandoffItem,
+ snapshot: &'a AgentRuntimeSnapshot,
+) -> Option<&'a str> {
let handoff_connection_id = item.connection_id.trim();
let active_connection_id = snapshot.active_connection_id.as_deref().map(str::trim)?;
if handoff_connection_id.is_empty() || handoff_connection_id != active_connection_id {
@@ -408,8 +411,10 @@ fn matching_snapshot_connection_name<'a>(item: &HandoffItem, snapshot: &'a Agent
}
fn conservative_production_risk(sql: &str) -> dbx_core::sql_safety::RiskMetadata {
- let mut risk =
- risk_for(sql, RiskContext { connection_name: "unknown", color: None, environment_label: Some("Production") });
+ let mut risk = risk_for(
+ sql,
+ RiskContext { connection_name: "unknown", color: None, environment_label: Some("Production") },
+ );
risk.is_production = true;
risk.risk_level = match classify_sql(sql) {
OperationClass::Ddl => RiskLevel::Critical,
@@ -553,7 +558,11 @@ mod tests {
AgentRuntimeState { app_state: Some(Arc::new(AppState::new(storage))), ..runtime_state() }
}
- fn connection_config(id: &str, name: &str, color: Option<&str>) -> dbx_core::models::connection::ConnectionConfig {
+ fn connection_config(
+ id: &str,
+ name: &str,
+ color: Option<&str>,
+ ) -> dbx_core::models::connection::ConnectionConfig {
dbx_core::models::connection::ConnectionConfig {
id: id.to_string(),
name: name.to_string(),