Queries and results

The workbench is where you write SQL, run it, and read the results. Each open query is a tab; the editor is Postgres-aware, and results appear in the pane beside it.

The editor

The editor gives you autocomplete and hover documentation from the connected database's schema, plus live error markers from a real Postgres parser. Type to get suggestions; . and { trigger them too.

  • Choose the connection. The toolbar shows the current connection as a coloured dot and name. To change it, click the gear icon (Query settings) and pick a different Connection. A new draft defaults to the first available connection.
  • Saving is automatic. There is no Save button. The query autosaves shortly after you stop typing. The toolbar's save indicator reads Saving…, Saved, Unsaved changes, or flags a conflict if someone else edited the query, with a Review button.
  • Name a query by double-clicking its tab title. Naming a new draft saves it as a private query.
  • Version history. Click the history icon (Version history) to see past versions with their author, and Restore any of them. A restore writes forward as a new version, so it is always undoable.

If you cannot edit a query (you lack the capability, or it is not shared with you for editing), the editor opens read-only.

Running queries and reading results

Run the current SQL with the Run button or Cmd/Ctrl + Enter.

  • The Run button's label reflects what it will do, for example Run (limit 1,000) or Run statement (limit 1,000) when the editor holds more than one statement and only the statement under the cursor runs.
  • The caret next to Run opens Run settings: Run all statements (off by default, so only the statement under the cursor runs) and Limit with a Rows field. The default row limit is 1,000; unchecking Limit lifts it to the connection's ceiling (up to 100,000).
  • Runs are asynchronous: the results header shows a live status line such as Success · 12 rows · 1.2s, and a spinner while a run is in flight. Use Cancel to stop a run that is still going.
  • The results pane has Data, SQL, Chart, and Export tabs. The Data grid is sortable and paginated (25 / 50 / 100 rows per page). A result truncated at the row limit says so.

Variables

Variables turn a query into a form. Reference one in SQL as {{name}} (a date range binds as {{name_start}} and {{name_end}}), and whoever runs the query supplies a value in the Variables bar above the editor. No SQL editing needed.

A query open with its variables bar above the editor
Variables show above the editor, so whoever runs the query supplies a value without touching the SQL.

To define a variable, click Add variable in the Variables bar. In the editor dialog you set a Name, Label, Description, whether it is Required, its Type, a Default value, and per-type validation. The ten types are:

  • String, Number, Date, Boolean
  • Dropdown and Multiselect (choose from a fixed list)
  • SQL Query (options generated by a SQL statement, searched as you type)
  • Date range (a start and end date)
  • Timestamp and UUID
The New variable dialog showing all ten variable types
The variable editor: name, label, required, the type picker, a default, and per-type validation.

Supplying a value only needs permission to run the query; changing a variable's definition needs the Edit variables capability, so a runner sees the inputs but not the definition controls.

Exporting results

The Export tab downloads the full result set of a successful run, not just the page on screen. Choose CSV, JSON, or Excel (.xlsx). The export runs server-side and downloads from a short-lived signed URL, opened in a new tab.