Skip to main content

Drafts

Drafts let you change a query without immediately affecting the live version. This is essential when a query is already shared or published as an API, and you want to edit it safely.

How drafts work​

When you edit a live query, your changes can be kept as a draft:

  • The published version keeps serving shared query links, shared dashboards, the public query API, the MCP server and its REST API and scheduled runs, and the Swagger documentation describes it. The queries these pages start — a linked query, the add button or an import — run their published version as well. An editor of the query who is signed in can view the draft through a shared link, a shared dashboard or the public query API by adding ?draft to it.
  • The draft holds your in-progress changes until you decide what to do. In the Kvery web app the query runs in its draft version — in the editor and on dashboards.

Drafts are kept only while the query is shared. Saving a query that is not shared makes the change live at once. If you turn sharing off while a draft is pending, the draft becomes the version that runs everywhere, including the MCP server and scheduled runs. When you share the query again, it is a draft again until you publish or discard it.

This means you can iterate on SQL and test it while shared links and the public query API keep serving the published version, and only switch them over to the new version when you are confident.

Reviewing the draft diff​

Before publishing, view the diff between the published version and the draft. The diff highlights exactly what differs in the SQL, so you can confirm the change is what you intended and avoid surprises for anyone consuming the query.

Publishing a draft​

Publish promotes the draft to be the live version. From that moment, shared links (of queries and dashboards), the public query API, the MCP server and scheduled runs use the new SQL as well, and the cached results of the query are cleared. The previous version is preserved in history so you can always roll back.

Discarding a draft​

If you decide not to keep your changes, discard the draft. The live version is untouched and your draft changes are dropped; from then on, the editor and dashboards run the published version as well, and the cached results of the query are cleared.

  1. Open the live query and make your changes — they are held as a draft.
  2. Run the draft to test it.
  3. Review the draft diff to confirm the change.
  4. Publish to go live, or discard to abandon the change.

Because every publish is captured in history, even a mistaken publish can be rolled back quickly.