Docs / Run queries and read results

← User guide

Run queries and read results

JOIN completion from the foreign keys

Run a statement

  1. Double-click a connection (or a table) to open a SQL editor.
  2. Type a statement. Ctrl+Space completes keywords, tables and columns; JOIN offers the related tables from the foreign keys.
  3. Press Ctrl+Enter to run the statement under the cursor (or the selection), or Alt+X to run the whole script. Ctrl+\ runs into a new result tab.
  4. Ctrl+. cancels a statement that is running.

Statements end at a ;, or at a blank line before a word that starts a new one. When a statement fails, the error is pointed out in the text and the error panel offers Go to the error. Ctrl+Shift+F formats the script; Ctrl+S saves it as a .sql file.

Parameters and variables

:id and ? in a statement, and ${name} variables, are asked in a dialog before the run and kept in a Variables panel. A ${name} value goes into the SQL as it is, so a statement with variables is checked again filled in (see Safety).

Read the results

Cells that hold files, with their type and size

Understand a slow query

Press Ctrl+Shift+E on a statement to see its plan. See FEATURES.md.

More

Saved scripts, snippets, history, vim mode, running a script on several connections, the query builder and data analysis are in FEATURES.md. The result grid is in FEATURES.md.