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
fix: [#691] harden sql_explain and altimate_core_validate inputs
Reject empty/placeholder SQL and warehouse names in sql_explain before
calling the warehouse. Add dialect-aware EXPLAIN (Snowflake, Postgres,
Redshift, MySQL, DuckDB, Databricks, ClickHouse). Translate driver
errors into actionable guidance.
Remove altimate_core_validate no-schema hard-gate so the engine runs
when schema is absent, with a has_schema flag in metadata.
Closes#691
return`Warehouse ${JSON.stringify(warehouseName??"")} is not configured. Available warehouses: ${availableWarehouses.join(", ")}. Pass one of these as the 'warehouse' parameter, or omit it to use the default.`
298
+
}
299
+
return"No warehouses are configured. Run `warehouse_add` to set one up before calling sql_explain."
300
+
}
301
+
302
+
// Unsubstituted-placeholder compilation errors from Snowflake / PG / MySQL.
return"SQL compilation error: the query contains an unsubstituted `?` placeholder. sql_explain does not support parameterized queries — inline the literal value before calling."
// Warehouse does not support EXPLAIN via a simple statement prefix —
427
+
// return a clear error rather than sending a bare statement to the
428
+
// driver. BigQuery needs a dry-run job, SQL Server needs SHOWPLAN_TEXT,
429
+
// Oracle needs DBMS_XPLAN, etc.
430
+
return{
431
+
success: false,
432
+
plan_rows: [],
433
+
error: `sql_explain is not supported for warehouse type ${JSON.stringify(warehouseType)}. This warehouse requires a different plan mechanism (e.g. dry-run API, SET SHOWPLAN_TEXT ON, or DBMS_XPLAN) that sql_explain cannot issue directly.`,
"Validate SQL syntax and schema references. Checks if tables/columns exist in the schema and if SQL is valid for the target dialect. IMPORTANT: Provide schema_context or schema_path — without schema, all table/column references will report as 'not found'.",
8
+
"Validate SQL syntax and schema references. Checks if tables/columns exist in the schema and if SQL is valid for the target dialect. If no schema_path or schema_context is provided, validation still runs but schema-dependent checks (table/column existence) are skipped — syntax and dialect checks still apply. For full validation, run `schema_inspect` first on the referenced tables or pass `schema_context` inline.",
9
9
parameters: z.object({
10
10
sql: z.string().describe("SQL query to validate"),
11
11
schema_path: z.string().optional().describe("Path to YAML/JSON schema file"),
0 commit comments