INNER CODE UNIT · Rust

connection_test

slothflowlabs/duckle · apps/desktop/src/lib.rs:385

async fn connection_test(payload: JsonValue) -> Result<duckle_duckdb_engine::ConnectionTest, String> {
    let eng = engine()?;
    tokio::task::spawn_blocking(move || eng.test_connection(&payload))
        .await
        .map_err(|e| e.to_string())
}

#[tauri::command]
async fn autodetect_schema(
    format: String,
    mut options: JsonValue,
    workspace_path: Option<String>,
) -> Result<InspectionPayload, String> {
    // #363: a node on a saved connection autodetects the way it runs, with the
    // connection's fields, instead of failing "host required".
    let refers = options.get("connectionRef").and_then(|v| v.as_str()).is_some_and(|s| !s.is_empty());
    match workspace_path.as_deref().filter(|w| !w.is_empty()) {
        Some(ws) => duckle_secrets::resolve_connection_ref_props(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…