> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mora.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reviewing AI edits

> Review AI-proposed query changes as a diff, then save to publish.

When the AI modifies your SQL query, it writes the change straight into your **draft query**. The editor highlights what changed as a diff against your last saved query, so you can review before publishing.

## How it works

1. You ask the AI to change your query (e.g. "add a WHERE clause for active users").
2. The AI writes the updated SQL into your draft.
3. The editor shows a **diff** against your saved query, additions in green, removals in red.
4. 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.

This way you always see exactly what changed since your last save.

## Related

* [Draft and publish](/datasets/draft-suggest-publish), the full query lifecycle.
* [SQL errors](/ai/sql-errors), debugging with the AI.
* [AI overview](/ai/overview)
