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(core): gate mq-admin-only transport helpers behind feature flag

t8y2840e80e8e098
diff --git a/crates/dbx-core/src/connection.rs b/crates/dbx-core/src/connection.rs
index 4d761881ef..238ac37424 100644
--- a/crates/dbx-core/src/connection.rs
+++ b/crates/dbx-core/src/connection.rs
@@ -24,7 +24,7 @@ use crate::db::proxy_tunnel::ProxyTunnelManager;
use crate::db::ssh_tunnel::TunnelManager;
use crate::models::connection::{
database_info_from_protocol_value, parse_jdbc_host_port, parse_mongo_first_host, rewrite_jdbc_url_host,
- ConnectionConfig, ConnectionTestResult, DatabaseConnectionInfo, DatabaseType, ProxyType, TransportLayerConfig,
+ ConnectionConfig, ConnectionTestResult, DatabaseConnectionInfo, DatabaseType, TransportLayerConfig,
};
use crate::path_utils::expand_tilde;
use crate::plugins::{PluginDriverSession, PluginRegistry, PluginRuntimeEnv};
@@ -2684,6 +2684,9 @@ impl AppState {
connection_id: &str,
transport_layers: &[TransportLayerConfig],
) -> Result<crate::mq::config::MqSocksProxy, String> {
+ // ProxyType 仅此 mq-admin 分支用到,局部导入避免在关闭 mq-admin 时
+ // 顶层 import 触发 unused 警告。
+ use crate::models::connection::ProxyType;
let final_layer = transport_layers.last().ok_or("No transport layers configured")?;
match final_layer {
TransportLayerConfig::Ssh(_) => {
diff --git a/crates/dbx-core/src/db/proxy_tunnel.rs b/crates/dbx-core/src/db/proxy_tunnel.rs
index a4437a348f..cc4e27019f 100644
--- a/crates/dbx-core/src/db/proxy_tunnel.rs
+++ b/crates/dbx-core/src/db/proxy_tunnel.rs
@@ -136,6 +136,7 @@ async fn connect_via_proxy(proxy: &ProxyEndpoint, remote: &RemoteEndpoint) -> Re
}
}
+#[cfg(feature = "mq-admin")]
pub(crate) async fn connect_via_socks5_proxy(
proxy_host: &str,
proxy_port: u16,
diff --git a/crates/dbx-core/src/db/transport_layer_tunnel.rs b/crates/dbx-core/src/db/transport_layer_tunnel.rs
index ad33eca79b..80efcdc11c 100644
--- a/crates/dbx-core/src/db/transport_layer_tunnel.rs
+++ b/crates/dbx-core/src/db/transport_layer_tunnel.rs
@@ -85,6 +85,7 @@ pub(crate) async fn start_transport_layers_with_final_ssh_local_port(
.await
}
+#[cfg(feature = "mq-admin")]
pub(crate) async fn start_transport_layers_with_final_ssh_socks5(
connection_id: &str,
layers: &[TransportLayerConfig],