User Guide

4. Query editor

Chapter 4 of 14 · JiveDB User Guide

The query editor is where you write and run SQL. It uses CodeMirror, with schema-aware autocomplete, a SQL formatter, and multi-statement support. This chapter walks through writing, running, and formatting a query, plus the result grid's filter and column controls.


1. Opening a query tab

Click New query in the toolbar, or right-click a schema/database and choose New Query (see Chapter 3). A new tab opens with an empty SQL editor.

The editor toolbar has these buttons: Load SQL, Run, Format, Favorites, AI, followed by a connection picker and, for PostgreSQL, a combined database/schema picker.

2. Autocomplete while typing

As you type, JiveDB suggests table names, column names, and keywords based on your actual connected database — not just generic SQL keywords.

Typing "SELECT * FROM" shows a dropdown of real table names from the connected database
Figure 4.1 — Autocomplete suggesting table names after FROM.

3. Running a query

  1. Type your SQL. You can put more than one statement in the same editor, separated by semicolons.
  2. Press ⌘/Ctrl+R, or click Run in the toolbar.
    • If you have selected some text, JiveDB runs exactly that selection.
    • If nothing is selected, JiveDB finds the statement your cursor is inside of, highlights it, and runs only that one statement.
  3. The result appears as a table below the editor.
A query result shown as a table below the SQL editor
Figure 4.2 — Query result shown in the grid below the editor.

The result grid has its own toolbar (a quick search box, Filter, Columns, Find, Format, a density toggle, Export, and Cell detail) — these work the same way as the full data grid described in Chapter 7.

4. Formatting SQL

Click Format in the editor toolbar (or press Shift+Alt+F) to reformat your whole SQL buffer into a clean, indented layout:

SQL on a single line before formatting
SQL reformatted onto multiple indented lines after clicking Format
Unformatted Formatted
Figure 4.3 — Drag the handle to compare unformatted SQL and formatted SQL.

Formatting rewrites the entire editor content, not just the statement under your cursor.

5. Filtering result columns

The result grid's Filter button opens a per-column filter row, with an operator picker for each column:

The Filter operator dropdown, listing comparison operators like Contains, Equals, Greater than
Figure 4.4 — Available filter operators for a result column.

Available operators:

  1. Click Filter to reveal a filter box under each column header.
  2. Type a value into the box for the column you want to filter.
  3. Click the small operator icon inside that box to change which comparison it uses (default is Contains).
A filter box under each column header, with the operator dropdown open for one column
Figure 4.5 — Filtering the user_id column, with its operator dropdown open.
Note: This filters the rows already loaded in the grid. It does not change your SQL — to filter at the database level, add a WHERE clause to your query instead.

6. Showing and hiding result columns

Click Columns in the result grid toolbar to choose which columns are visible:

The Columns dropdown, with a checklist of every column and a search box
Figure 4.6 — Choosing which columns to show, with Check all / Uncheck all and search.

7. Favorites and Load SQL

The Favorites dropdown, listing starred SQL statements
Figure 4.7 — The Favorites dropdown, showing previously starred statements.

Favorites are explained in full, together with the query history panel, in Chapter 5 — Query history and favorites.