Help › Work with results

Follow a foreign key

Peek at the row a foreign-key value refers to without leaving the result, or open it in a tab of its own.

Querlyn 0.1.0 is not released yet. This help describes it ahead of release.

When a column of a result is a foreign key, its values point at rows of another table. Querlyn can show you that row on the spot.

Peek at the referenced row

Cells of a foreign-key column have a small arrow at their right edge. To see the row a value points at, do any of these:

  • Click the arrow.
  • ⌘ on macOS or Ctrl on Windows and Linux-click the cell.
  • Move to the cell and press ⌥↓ on macOS or Alt+Down on Windows and Linux (Command Palette › Results: Show Referenced Row).

A small window opens under the cell and lists the referenced row's fields. It does not change the result you are in.

In the small windowKey
Move between fields and buttonsThe arrow keys, ⇥ on macOS or Tab on Windows and Linux
Follow a foreign key of the row shown, one level further↩ on macOS or Enter on Windows and Linux on that field
Go back to the first row⌫ on macOS or Backspace on Windows and Linux, or Back
Open the row in a tabOpen in Tab
Close⎋ on macOS or Esc on Windows and Linux, Close, or a click outside

The keyboard starts on Open in Tab, so ⌥↓ on macOS or Alt+Down on Windows and Linux followed by ↩ on macOS or Enter on Windows and Linux opens the row in a tab.

Open the referenced row in a tab

Choose Open in Tab in the small window, or press ⌥⇧↓ on macOS or Alt+Shift+Down on Windows and Linux on the cell (Command Palette › Results: Open Referenced Row in New Tab). A new query tab opens on the same connection with a SELECT on the referenced table for that value, and runs it. From there you can edit the row like any result.

What you may see

You seeMeaning
"No matching row."Nothing in the referenced table has that value.
"N rows match; showing the first"Several rows have the value. This can happen where keys are not enforced, as on Amazon Redshift and Snowflake.
"Shows committed data: changes in this tab's open transaction are not included"The look-up runs outside your tab's transaction, so it does not see what you changed and have not committed.
A faint arrow that does nothingThe foreign key has several columns and the result does not include all of them. The arrow's tooltip names the missing columns.
No arrowThe value is NULL, or Querlyn cannot tell that the column is a foreign key; see below.

A look-up that takes longer than 15 seconds is stopped; another transaction may be holding a lock on the row.

Where arrows appear

Querlyn works out which table and column each result column comes from. It can do that for plain column references through aliases and joins. It shows no arrows for columns that come through a subquery, a WITH query, a view or a UNION, and none in the record view.

The look-ups are not recorded in the query history, and they are listed in the statement console under Peek.

Filter by a value

To see which loaded rows share a cell's value, right-click the cell and choose Filter by This Value; see Show only rows with one value.

Help for Querlyn 0.1.0. All help topics