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 — on its run page, in the editor, on dashboards, in the windows of add buttons and link fields, and in imports started in the app. While the query has a draft, the save buttons of the editor read Save (Draft) and Save (Draft) and Run, and saving shows "Saved! (Draft)".

A draft holds the SQL and the form fields. The query's other settings — its description, connection and the settings panels — take effect everywhere when you save.

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​

While a shared query has a draft, the editor shows the notice "Draft Mode: This shared query has unpublished changes." with the time the draft was saved ("(Draft saved: …)"). Before publishing, click View Changes in it to see the diff between the published version and the draft: the Query tab compares the SQL and the Form Settings tab the form settings, so you can confirm the change is what you intended and avoid surprises for anyone consuming the query. This window has no Rollback button.

If you change the SQL and the form back to the published version (white space in the SQL aside) and save, the draft is removed.

Publishing a draft​

Publish Draft in the editor promotes the draft to be the live version, after you confirm "Are you sure you want to publish the draft? This will make the changes live on the shared URL."; Kvery then reports "Draft successfully published to live!". 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, click Discard Draft in the editor and confirm "Are you sure you want to discard the draft? This will delete all unpublished changes."; the editor then reloads with the published version. 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 (View Changes) to confirm the change.
  4. Publish Draft to go live, or Discard Draft to abandon the change.

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