Docs/AI Chat

Fix a Failed Query

Use Fix with AI when a query in the SQL Console fails and you want a corrected version without copying the query or error message into chat.

Fix the error

  1. Run the query in a SQL Console.
  2. In the Query Error panel, click Fix with AI.
Query Error panel with the Fix with AI action
  1. AI receives the failed query and the exact database error, checks the relevant schema, and writes a corrected query into the editor.
  2. Review the highlighted SQL. Click Run to test it, then choose Keep or Revert.
A corrected SQL query highlighted in the editor with Revert and Keep actions

Keep accepts the replacement. Revert restores the query that failed. Running the corrected query does not accept it automatically, so you can inspect the result first.

If the fix is not right

Click Revert, adjust the request yourself, or open AI Chat to discuss why the query failed. The original query remains available until you choose Keep.

Next