You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if !crate::drivers::common::is_explainable_query(&sanitized_query){
2092
+
returnErr(
2093
+
"EXPLAIN is only supported for DML statements (SELECT, INSERT, UPDATE, DELETE, REPLACE). DDL statements like CREATE, DROP, or ALTER cannot be explained."
2094
+
.into(),
2095
+
);
2096
+
}
2097
+
2098
+
let saved_conn = find_connection_by_id(&app,&connection_id)?;
2099
+
let expanded_params = expand_ssh_connection_params(&app,&saved_conn.params).await?;
2100
+
let params = resolve_connection_params_with_id(&expanded_params,&connection_id)?;
2101
+
2102
+
let drv = driver_for(&saved_conn.params.driver).await?;
constDEFAULT_SYSTEM_PROMPT:&str = "You are an expert SQL assistant. Your task is to generate a SQL query based on the user's request and the provided database schema.\nReturn ONLY the SQL query, without any markdown formatting, explanations, or code blocks.\n\nSchema:\n{{SCHEMA}}";
381
381
constDEFAULT_EXPLAIN_PROMPT:&str =
382
382
"You are a helpful SQL assistant. Explain SQL queries in {{LANGUAGE}}.";
383
+
constDEFAULT_EXPLAINPLAN_PROMPT:&str =
384
+
"You are a database performance expert. Analyze the following SQL query and its EXPLAIN plan output. Identify performance bottlenecks, suggest index improvements, and explain the execution strategy. Respond in {{LANGUAGE}}.";
383
385
constDEFAULT_CELLNAME_PROMPT:&str = "You are an assistant that generates concise, descriptive names for notebook cells.\nGiven a SQL query or Markdown content, return ONLY a short name (3-6 words max) that describes what the cell does or what it is about.\nDo not include quotes, punctuation, or explanations. Just the name.";
384
386
constDEFAULT_TABRENAME_PROMPT:&str = "You are an assistant that generates concise, descriptive names for SQL query result tabs.\nGiven a SQL query, return ONLY a short name (3-6 words max) that describes what the query does.\nDo not include quotes, punctuation, or explanations. Just the name.";
0 commit comments