Console history and run log

A console keeps two records of its past: the saved versions of its text and a log of its runs. Use them to see how a query changed over time, to bring back an earlier version, and to check what each run returned. Creating, saving and reopening consoles is covered on Consoles, saving and history.

Read a console's runs

The run log is the History tab in the Results Panel.

  1. Open the History tab in the Results Panel. Its tooltip reads History. The tab lists the console's runs with the newest at the bottom, and it scrolls to the newest entry when you open it.
  2. Read an entry. A status dot shows how the run went, with the time it was recorded as [YYYY-MM-DD HH:MM:SS] in 24-hour time. While a run is going, the entry reads running or pending with the seconds elapsed so far. When the run ends, the entry shows the rows it returned (a single row reads 1 row) and how long it took, such as 9 ms, 1 s 88 ms or 2 m 5 s; a run under a millisecond reads <1 ms.
  3. Expand an entry to read its SQL. The SQL shows the parameter values the run used, and a failed run also shows its error message.

You can act on an entry:

With no runs yet, the tab reads No Query Outputs and "Query outputs will appear here after you execute queries". The tab lists the 10 most recent runs of the console.

Compare saved versions

Console history keeps the saved versions of a console's text.

  1. Click Console history in the editor toolbar, or press Ctrl+Shift+H. You can also click View History on a console in the Consoles panel.
  2. The list shows the versions by date and time, newest first. The oldest version is badged First. Select a version.
  3. Choose vs Prev to compare it with the version before it, or vs Now to compare it with the console's current text. The chosen version reads Selected Version with its date; the other side reads Previous Version with its date (vs Prev) or Current Query (vs Now); when the oldest version is selected, the other side reads Original Version. The panes scroll together.
  4. To use an older version, click Copy on its side of the comparison (the button reads Copied when done), then paste the text into the console. The comparison has no restore button.

While the list loads it reads Loading history; before you pick a version it reads Select a history entry to view the query; a console with no saved versions reads No history available. Close the view with Close.

What creates a version

Questions, answered

How do I get back an earlier version of my query?

Open Console history with Ctrl+Shift+H, select the version and choose vs Now to check it against the current text. Click Copy on that version's side of the comparison, then paste the text into the console.

What is the difference between Console history and the History tab?

Console history keeps the saved versions of the console's text. The History tab lists the console's recent runs, with each run's status, rows and time.

How many runs does the History tab keep?

It lists the 10 most recent runs of the console; older runs drop off as new ones arrive.

Why does a running entry have no row count yet?

The run has not finished, so the entry reads running or pending with the seconds elapsed so far. The row count and the run time appear when it ends.

Why is Run this query greyed out?

A query is already running in this console; the button's tooltip reads Query is already running. Wait for the run to finish, then run the entry again.

How do I copy a failed run's error?

Click Copy error message on the failed entry; the button confirms with Copied!. The action appears only on entries that failed.

What do vs Prev and vs Now compare?

vs Now compares the selected version with the console's current text; vs Prev compares it with the version recorded before it.

What does the First badge mean?

It marks the oldest saved version in the list.

Does the run log keep my parameter values?

Yes. Each entry's SQL shows the query with the values it ran with, so Copy SQL copies the query as it ran. See Query parameters.

Do the runs stay there after I reload?

Yes. The runs are stored with the console, so its recent runs come back when you reopen it.

When is a version recorded?

A run records one when the text differs from the newest recorded version. Save records one even when the text is unchanged.