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:
@@ -254,6 +254,12 @@ export const listOllamaModels = (ollamaUrl: string) =>
|
||||
export const generateSql = (connectionId: string, prompt: string) =>
|
||||
invoke<string>("generate_sql", { connectionId, prompt });
|
||||
|
||||
export const explainSql = (connectionId: string, sql: string) =>
|
||||
invoke<string>("explain_sql", { connectionId, sql });
|
||||
|
||||
export const fixSqlError = (connectionId: string, sql: string, errorMessage: string) =>
|
||||
invoke<string>("fix_sql_error", { connectionId, sql, errorMessage });
|
||||
|
||||
// Entity Lookup
|
||||
export const entityLookup = (
|
||||
config: ConnectionConfig,
|
||||
|
||||
Reference in New Issue
Block a user