feat(ai-agent): Phase 3 — explain_query tool, parallel/sequential execution, DB gating (#1187)
- Add explain_query tool with structured EXPLAIN result, gated on supports_explain_plan() - Add supports_sql_query() to gate execute_query/get_sample_data for non-SQL DBs (Redis, ES, MongoDB, etc.) - Split agent loop tool dispatch: execute_query runs sequentially, all others run in parallel via join_all - Wire explain_query result button to ExplainPlanViewer in AiAssistant + App.vue - Fix O(n²) agentSteps rebuild: incremental O(1) push per event during streaming - finally block falls back to full rebuild only when streaming push did not occur
This commit is contained in:
1 parent
a3c972c367
commit
d845a318c6
8 files changed
+284
-42
No files matched your search
@@ -79,6 +79,20 @@ pub fn supports_explain_plan(database_type: Option<DatabaseType>) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
/// Returns true for databases that support SQL query execution (execute_query / get_sample_data).
|
||||
/// Non-SQL databases (Redis, MongoDB, Elasticsearch, InfluxDB, Neo4j, etcd) are excluded.
|
||||
pub fn supports_sql_query(database_type: DatabaseType) -> bool {
|
||||
!matches!(
|
||||
database_type,
|
||||
DatabaseType::Redis
|
||||
| DatabaseType::MongoDb
|
||||
| DatabaseType::Elasticsearch
|
||||
| DatabaseType::InfluxDb
|
||||
| DatabaseType::Neo4j
|
||||
| DatabaseType::Etcd
|
||||
)
|
||||
}
|
||||
|
||||
pub fn is_safe_dameng_autotrace_sql(sql: &str) -> bool {
|
||||
let source = strip_trailing_semicolons(sql.trim());
|
||||
if source.is_empty() || has_extra_statement_after_semicolon(&source) {
|
||||
|
||||
Reference in new issue
Block a user