How it works
- You ask the AI to change your query (e.g. “add a WHERE clause for active users”).
- The AI writes the updated SQL into your draft.
- The editor shows a diff against your saved query, additions in green, removals in red.
- You review (and tweak) the draft, then save to publish.
Keeping changes
Edit the draft further if you want, then save (Cmd+S) to publish. Saving promotes the draft to your saved query and the diff clears.Discarding changes
To undo AI changes you don’t want, edit the draft back (standard Cmd+Z undo works) or re-run the query. Nothing is published until you save.When the diff appears
The editor shows the diff for any unsaved change, whether made by you or the AI:- Fixing errors after “Send to chat.”
- Adding columns, filters, or joins.
- Optimizing or rewriting queries.
- Any change requested in the chat.
Related
- Draft and publish, the full query lifecycle.
- SQL errors, debugging with the AI.
- AI overview
