feat(sqlserver): support legacy TLS compatibility

This commit is contained in:
zipg authored and GitHub committed 2026-07-09 22:45:54 +08:00
1 parent 63ef26b25a
commit 67edb94b1d
30 files changed
+738 -117

No files matched your search

+5
View File
@@ -29,6 +29,11 @@ pub async fn list_installed_agents(state: State<'_, Arc<AppState>>) -> Result<Ve
Ok(build_agent_list(&state.agent_manager, registry.as_ref()))
}
#[tauri::command]
pub async fn is_agent_installed(state: State<'_, Arc<AppState>>, db_type: String) -> Result<bool, String> {
Ok(state.agent_manager.is_driver_installed(&db_type))
}
#[tauri::command]
pub async fn get_driver_store_usage(state: State<'_, Arc<AppState>>) -> Result<DriverStoreUsage, String> {
Ok(state.agent_manager.collect_driver_store_usage(state.plugins.root_dir()))
+4 -22
View File
@@ -747,17 +747,9 @@ pub async fn test_connection(state: State<'_, Arc<AppState>>, config: Connection
.await
.map(|_| "Connection successful".to_string())
}
DatabaseType::SqlServer => db::sqlserver::connect(
&host,
port,
&config.username,
&config.password,
config.database.as_deref(),
config.url_params.as_deref(),
connect_timeout,
)
.await
.map(|_| "Connection successful".to_string()),
DatabaseType::SqlServer => {
state.test_sqlserver_connection_with_legacy_fallback(&config, &host, port, connect_timeout).await
}
DatabaseType::Elasticsearch => {
let mut client = db::elasticsearch_driver::EsClient::from_config(
&url,
@@ -1047,17 +1039,7 @@ pub async fn connect_db(
PoolKind::ClickHouse(client)
}
DatabaseType::SqlServer => {
let client = db::sqlserver::connect(
&host,
port,
&db_config.username,
&db_config.password,
db_config.database.as_deref(),
db_config.url_params.as_deref(),
connect_timeout,
)
.await?;
PoolKind::SqlServer(std::sync::Arc::new(tokio::sync::Mutex::new(client)))
state.connect_sqlserver_pool_with_legacy_fallback(&db_config, &host, port, connect_timeout).await?
}
DatabaseType::Elasticsearch => {
let mut client = db::elasticsearch_driver::EsClient::from_config(