> ## 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.

# Draft and publish

> Understand the query lifecycle, from working draft to published result.

Every dataset query moves between two states. This flow lets you iterate quickly and review changes before they take effect.

## Draft

The **draft query** is whatever is currently in the SQL editor. It's your working copy, edited by you or by the AI. Changes to the draft are saved locally and don't affect the published dataset or any charts.

You can preview the draft at any time by pressing **Cmd+Enter**.

When the draft differs from the published query, the editor shows a **diff** highlighting what changed, additions in green, removals in red. This applies to your own edits and to changes the AI makes. See [Reviewing AI edits](/ai/accepting-suggestions) for more.

## Published query

When you save (**Cmd+S**), the current draft becomes the **published query**. Mora runs it in the background and materializes the results, and the diff clears. Any charts using this dataset will reflect the new data.

## Flow summary

```mermaid theme={null}
flowchart LR
    Draft[Draft query] -->|"diff vs published"| Review[Review changes]
    Review -->|"Save (Cmd+S)"| Published[Published query]
    Published --> Charts[Charts update]
```

## Related

* [SQL editor](/datasets/sql-editor)
* [Reviewing AI edits](/ai/accepting-suggestions)
* [Datasets overview](/datasets/overview)
