feat: add SSH config aliases and PostgreSQL extensions

This commit is contained in:
zergmk2 authored and GitHub committed 2026-07-05 20:29:49 +08:00
1 parent 8b035d0989
commit f800d80f90
35 files changed
+1191 -33

No files matched your search

+37
View File
@@ -4073,6 +4073,43 @@ pub async fn list_rules_core(
.await
}
pub async fn list_extensions_core(
state: &AppState,
connection_id: &str,
database: &str,
schema: &str,
) -> Result<Vec<db::ExtensionInfo>, String> {
retry_metadata_connection(state, connection_id, Some(database), || async {
let pool_key = state.get_or_create_pool(connection_id, Some(database)).await?;
let connections = state.connections.read().await;
let pool = connections.get(&pool_key).ok_or("Pool not found")?;
match pool {
PoolKind::Postgres(p) => db::postgres::list_extensions(p, schema).await,
_ => Ok(vec![]),
}
})
.await
}
pub async fn list_available_extensions_core(
state: &AppState,
connection_id: &str,
database: &str,
) -> Result<Vec<db::ExtensionInfo>, String> {
retry_metadata_connection(state, connection_id, Some(database), || async {
let pool_key = state.get_or_create_pool(connection_id, Some(database)).await?;
let connections = state.connections.read().await;
let pool = connections.get(&pool_key).ok_or("Pool not found")?;
match pool {
PoolKind::Postgres(p) => db::postgres::list_available_extensions(p).await,
_ => Ok(vec![]),
}
})
.await
}
pub async fn list_owners_core(
state: &AppState,
connection_id: &str,