feat(editor): add SQL semantic diagnostics

This commit is contained in:
t8y2 committed 2026-05-22 14:22:58 +08:00
1 parent 64c068bbf5
commit 0e189ba0cc
18 files changed
+997 -19

No files matched your search

+13
View File
@@ -44,6 +44,13 @@ pub struct ExecuteBatchRequest {
pub schema: Option<String>,
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnalyzeSqlReferencesRequest {
pub sql: String,
pub dialect: Option<String>,
}
pub async fn execute_query(
State(state): State<Arc<WebState>>,
Json(req): Json<ExecuteQueryRequest>,
@@ -174,3 +181,9 @@ pub async fn execute_in_transaction(
Ok(Json(serde_json::to_value(result).map_err(|e| AppError(e.to_string()))?))
}
pub async fn analyze_sql_references(
Json(req): Json<AnalyzeSqlReferencesRequest>,
) -> Result<Json<dbx_core::sql_analysis::SqlReferenceAnalysis>, AppError> {
dbx_core::sql_analysis::analyze_sql_references(&req.sql, req.dialect.as_deref()).map(Json).map_err(AppError)
}