Skip to main content

History and Rollback

Kvery keeps a version history of each query, so you can see what changed, when and by whom, and roll back if needed.

When a version is recorded​

A history entry holds the query's SQL, its form settings and its result layout as they were at that moment. A version is recorded:

  • when the query is created;
  • when a change of its SQL or of its form fields is saved — white space alone does not count as a change. A change saved as a draft is not recorded;
  • when a draft is published.

Saving only other settings (for example the result layout, the table settings or the cache), and a rollback, record no version. A cloned query starts with an empty history.

Viewing history​

Editors open a query's history with its History button, in the query list or in the editor. The Query history window lists the versions, newest first, with the time they were recorded (Created at), an identifier of the entry (Hash), the run statistics of the query at that moment (Views, Avg. runtime, Response codes) and the user who saved them (Created by).

The history lists the 100 newest versions of a query; older versions are not listed.

Comparing versions (diff)​

The View button of an entry opens the Query diff window. It compares the selected version with the version recorded before it: the earlier version is on the left, the selected one on the right, and the changed lines are highlighted.

  • The Query tab compares the SQL, the Form Settings tab the form settings (as JSON).
  • Inline? shows the changes in one column instead of side by side.

For the oldest entry the left side is empty. To see what changed since a version, compare the newer entries one by one.

Rolling back​

The Rollback button of the Query diff window (after the confirmation "Are you sure you want to roll back?") restores the SQL, the form settings and the result layout of the selected version, and opens the query in the editor.

  • A rollback does not add a history entry.
  • The restored version becomes the published version at once, also of a shared query: shared links, the public query API, the MCP server and scheduled runs use it right away.
  • An unpublished draft stays as it is: the editor and the runs in the app keep using the draft until you publish or discard it. A query that is not shared but still has a draft (sharing was turned off while it was pending) keeps running its draft everywhere.
  • Cached results stay until they expire: use the Clear cache button of the query's cache settings when callers must get results of the restored version at once (see Export and cache).

How history relates to drafts​

  • Drafts are about staging a change before it goes live.
  • History is the record of the versions that were saved or published.

A typical flow is: edit as a draft → review the draft diff → publish → (if needed later) open history and roll back. Together they give you a safe, reversible way to evolve queries that other people and systems depend on.

Why this matters​

Queries in Kvery are often production assets — they power API endpoints, scheduled emails, and dashboards. Versioning and rollback mean you can change them confidently and restore an earlier version when a change goes wrong.