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。

fix: add missing read_only field and resolve clippy warnings

t8y21545224d343b
diff --git a/src-tauri/src/commands/connection.rs b/src-tauri/src/commands/connection.rs
index 378951578c..4467102da4 100644
--- a/src-tauri/src/commands/connection.rs
+++ b/src-tauri/src/commands/connection.rs
@@ -195,6 +195,7 @@ mod tests {
jdbc_driver_class: None,
jdbc_driver_paths: Vec::new(),
one_time: false,
+ read_only: false,
}
}
diff --git a/src-tauri/src/commands/keychain.rs b/src-tauri/src/commands/keychain.rs
index 020a311fb0..57a9baed06 100644
--- a/src-tauri/src/commands/keychain.rs
+++ b/src-tauri/src/commands/keychain.rs
@@ -5,7 +5,7 @@ pub async fn read_keychain_password(service: String, account: Option<String>) ->
#[cfg(not(target_os = "macos"))]
{
let _ = (service, account);
- return Err("Keychain access is only available on macOS".to_string());
+ Err("Keychain access is only available on macOS".to_string())
}
#[cfg(target_os = "macos")]
@@ -32,9 +32,11 @@ fn read_keychain_password_blocking(service: String, account: Option<String>) ->
} else {
// Exit code 44 = user cancelled the authorization dialog
let stderr = String::from_utf8_lossy(&output.stderr).to_string();
- if output.status.code() == Some(44) || stderr.contains("User canceled") {
- Ok(String::new())
- } else if stderr.contains("could not be found") || stderr.contains("The specified item could not be found") {
+ if output.status.code() == Some(44)
+ || stderr.contains("User canceled")
+ || stderr.contains("could not be found")
+ || stderr.contains("The specified item could not be found")
+ {
Ok(String::new())
} else {
Err(format!("Keychain read failed: {}", stderr.trim()))
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 3f29267801..e09012ff8b 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -61,14 +61,14 @@ fn open_connection_deep_links(app: &tauri::AppHandle, links: Vec<String>) {
#[cfg_attr(not(any(target_os = "macos", target_os = "windows")), allow(dead_code))]
fn setup_desktop_tray<R: tauri::Runtime, M: Manager<R>>(
manager: &M,
- icon_theme: DesktopIconTheme,
+ _icon_theme: DesktopIconTheme,
) -> tauri::Result<()> {
let menu = MenuBuilder::new(manager).text("show", "Show DBX").separator().text("quit", "Quit DBX").build()?;
let mut tray =
TrayIconBuilder::<R>::with_id(DESKTOP_TRAY_ID).tooltip("DBX").menu(&menu).show_menu_on_left_click(false);
#[cfg(target_os = "macos")]
{
- match icon_theme {
+ match _icon_theme {
DesktopIconTheme::Default => {
tray = tray.icon(MACOS_TRAY_ICON).icon_as_template(true);
}
@@ -79,7 +79,7 @@ fn setup_desktop_tray<R: tauri::Runtime, M: Manager<R>>(
}
#[cfg(target_os = "windows")]
{
- let icon = match icon_theme {
+ let icon = match _icon_theme {
DesktopIconTheme::Default => manager.app_handle().default_window_icon().cloned(),
DesktopIconTheme::Black => Some(BLACK_APP_ICON),
};