feat: add AI Explain Query and Fix Error via Ollama

Extract shared call_ollama_chat helper from generate_sql to reuse
settings loading and Ollama API call logic. Add two new AI commands:
- explain_sql: explains what a SQL query does in plain language
- fix_sql_error: suggests corrected SQL based on the error and schema

UI additions: "AI Explain" toolbar button, "Explain" and "Fix with AI"
action buttons on query errors, inline explanation display in results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 18:48:39 +03:00
parent c001ad597f
commit 3ad0ee5cc3
6 changed files with 268 additions and 33 deletions

View File

@@ -94,6 +94,8 @@ pub fn run() {
commands::ai::save_ai_settings,
commands::ai::list_ollama_models,
commands::ai::generate_sql,
commands::ai::explain_sql,
commands::ai::fix_sql_error,
// lookup
commands::lookup::entity_lookup,
])