Query history

The query history window shows the saved versions of a query in a popup: what the SQL looked like before, how a version compares with what the editor holds now, and a Replace action that puts a version back. It opens from the editor header of a View, a Dictionary and a transformation.

The Editor keeps its own console history for the text of a console; that is a separate feature, described in Consoles, saving and history.

Open a query's history

  1. Open the popup on its query step: the Query step of a View or a transformation, or the Queries step of a Dictionary.
  2. Click History in the editor header. Its tooltip reads Query history.
  3. The window opens with the saved versions listed on the left under Versions, with the number of versions beside the heading. The newest version is selected and previewed on the right.

Read the versions list

Preview and compare a version

  1. Select a version. The Query tab shows its SQL in a read-only viewer.
  2. Click Compare to see the same version against the query that is in the editor now: the version is the original side, labelled Version v3 with its number, and the query in the editor is the other side, labelled Current Query.

Copy or replace

  1. To take a version out of the window, select it and click Copy query. The SQL goes to your clipboard and the button shows a check for two seconds.
  2. To put a version back into the query, select it and click Replace. The window closes, and the version's SQL goes into the query editor.

Questions, answered

Which popups have a query history?

A View and a transformation on their Query step, and a Dictionary on its Queries step. In each of them, History sits in the editor header and its tooltip reads Query history.

Why is the History button missing?

The popup is not ready for history yet. A View or a transformation shows the button once the object is created; a Dictionary query shows it once the dictionary is saved and the query has a source system.

What do the version numbers mean?

They count the saved versions from the newest to the oldest. The list runs newest first, so the newest version carries the highest number and the oldest carries v1.

Who is shown on each version?

The person who last edited that version. When that is not recorded, the version's creator is shown; when neither is known, the row reads Unknown.

What does Compare show?

The version you selected against the query that is in the editor right now. The version is the original side, labelled Version v3 with its number, and the current editor query is the other side, labelled Current Query.

What happens when I click Replace?

The selected version's SQL goes into the query editor and the window closes. The query counts as not validated again, so validate it before you save.

Can I copy a version without replacing the query?

Yes. Select the version and click Copy query; the SQL goes to your clipboard and the button shows a check for two seconds. Nothing in the editor changes.

Does closing the window change my query?

No. Only Replace changes what the editor holds. Closing the window, selecting other versions and comparing leave your query as it was.

Why does the list say "No query history yet"?

The query has no saved versions yet. Versions are added as the query is saved: each save with a changed query adds a new version.

Is this the same as Query Management?

No. Query Management records every query that ran on your data, with its user and duration. This window keeps the saved versions of one query inside its popup.

Is this the same as console history in the Editor?

No. Console history keeps versions of a console's text in the Editor and you bring one back by copying it, while this window's Replace puts a version straight into the query.