Browse documentation

Query

Results grid

A query result opens in a grid under the editor. The rows stay in the app's native layer and reach the window in pages, so a large result does not stall the interface.

Where to find it

ActionHow
Read a resultThe results pane under the editor
Switch between result setsResult 1, Result 2 and so on, above the grid
See one value in fullSpace, or Quick Look in the context menu
Copy cellsCopy, Copy cell value, Copy column values and Copy as in the context menu
ExportExport result... above the grid, or Export selection... in the context menu
Cancel a running queryCancel, ⌘. (Ctrl+.)

Reading the grid

Each heading shows the column name with its database type beneath it. NULL appears as an italic NULL, never as an empty cell, and a JSON value carries a {} badge. The strip above the grid counts the stored rows, and the footer shows the row count, the time taken and the statement.

Orders 25 to 64 in the grid, with a type under each column name, an italic NULL in shipping_address for order 31, and JSON addresses marked with a {} badge.
Types sit under the column names, and NULL never looks like an empty string.

Paging and large results

Rows reach the window 500 at a time as you scroll. A query collects at most 100,000 rows or 256 MB of values, whichever comes first, and Maximum rows per query and Maximum result memory in Preferences > Data change both limits. When a result reaches a limit, a banner says the query was stopped early, and the footer count gains a + and a truncated badge.

The grid loads rows in pages while the total is known from the start.
A generate_series query stopped at 100,000 rows, with a banner reading Showing the first 100,000 rows and a truncated badge beside the row count in the footer.
A capped result says so instead of looking complete.

Several result sets

Run all gives each statement that returns rows its own tab, named Result 1, Result 2 and so on, and opens the last one. Select a tab to show its rows, column types and footer.

Result 1, Result 2 and Result 3 tabs above the grid after running three statements, with Result 2 selected and showing five authors.
Each statement that returns rows gets its own tab.

Copying

Right-click a selection for Copy, Copy cell value, Copy column values and Copy as. Copy as offers TSV, CSV, CSV with header, JSON and Markdown table, and SQL INSERT stays disabled in query results. Copies carry the values the database returned, not the way a cell is drawn.

The grid context menu open on a block of selected cells, with the Copy as submenu listing TSV, CSV, CSV with header, JSON and Markdown table, and SQL INSERT disabled.
Every copy format carries the stored values.

Quick Look

Space on the selected cell, or Quick Look in the context menu, opens the cell's full value with its column name and type. JSON opens formatted, with Pretty and Raw to switch between layouts, and Wrap and Copy above the value. Esc closes it. In table data, the row inspector shows a whole row at once.

Quick Look open on the metadata cell of book 3, showing the JSONB value over several lines with Pretty, Raw, Wrap and Copy controls and Row 3 in its footer.
Quick Look shows the whole stored value, however narrow the column.

Good to know

  • Dates and times appear as the server sends them.
  • Export result... writes every stored row, not only the rows on screen. See Export and import.
  • Running the tab again replaces its results.
  • Column aliases can change how a column is drawn without changing what is copied. See Result display directives.