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
- Open the popup on its query step: the Query step of a View or a transformation, or the Queries step of a Dictionary.
- Click History in the editor header. Its tooltip reads Query history.
- 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.
- The button needs a saved object: it does not appear until the View or the transformation is created, and on a Dictionary query it appears once the dictionary is saved and the query has a source system.
- Every time the window opens, the newest version starts selected and the window starts on the Query tab.
Read the versions list
- Each row shows the version chip, such as v3, the date and time it was saved, and the person it is credited to: the version's last editor, falling back to its creator, and then to Unknown.
- The list runs newest first, and the version numbers follow it: the newest version carries the highest number.
- Click a row to select it; the selected row stays highlighted, and the pane on the right follows it.
- While the list is loading it reads "Loading history...". When the query has no saved versions, it reads "No query history yet".
Preview and compare a version
- Select a version. The Query tab shows its SQL in a read-only viewer.
- 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.
- The pane header repeats the version number and its time.
- Looking at versions changes nothing: neither the preview nor the comparison edits your query.
- With nothing to show yet, the pane reads "Select a version to preview its query".
Copy or replace
- 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.
- 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.
- A replaced query counts as not validated, so validate it again before you save the object.
- Nothing is saved for you: the replaced query stays in the editor until you save the step as usual.
- Only Replace changes your query. Opening the window, comparing versions, copying and closing leave the query as it was.
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.