Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

SQL Editor

Execute PostgreSQL queries with a modern code editor.

Features

  • Monaco Editor - Same editor as VS Code
  • Syntax Highlighting - PostgreSQL-aware highlighting
  • Auto-completion - Tables, columns, functions
  • Multiple Tabs - Work on multiple queries
  • Query History - Access previous queries
  • Result Export - CSV and JSON formats

Executing Queries

Basic Execution

Type your query and press Ctrl+Enter (or Cmd+Enter on Mac):

SELECT * FROM users WHERE active = true;

Multiple Statements

Separate statements with semicolons:

SELECT COUNT(*) FROM users;
SELECT COUNT(*) FROM posts;
SELECT COUNT(*) FROM comments;

All results appear in separate tabs.

Execute Selection

Select specific text and press Ctrl+Shift+Enter:

-- This won't run
SELECT * FROM users;
 
-- Only this runs when selected
SELECT * FROM posts;

Auto-completion

The editor provides intelligent suggestions:

Tables

SELECT * FROM us|

              users
              user_sessions
              user_roles

Columns

SELECT email, |

              id
              name
              created_at

Functions

SELECT NOW|

          NOW()
          NULLIF()

Keywords

SEL|

   SELECT
   SELF

Query Results

Table View

Results display in a sortable, scrollable table:

idemailname
1alice@example.comAlice
2bob@example.comBob

Row Count

Shows affected rows for INSERT, UPDATE, DELETE:

Query executed successfully
3 rows affected
Time: 45ms

Errors

Syntax and runtime errors display with line numbers:

ERROR: column "emali" does not exist
LINE 1: SELECT emali FROM users
               ^
HINT: Perhaps you meant to reference the column "users.email"

Exporting Results

CSV Export

Click "Export CSV":

id,email,name,created_at
1,alice@example.com,Alice,2026-01-25 10:30:00
2,bob@example.com,Bob,2026-01-25 11:00:00

JSON Export

Click "Export JSON":

[
  {"id": 1, "email": "alice@example.com", "name": "Alice"},
  {"id": 2, "email": "bob@example.com", "name": "Bob"}
]

Query History

Access previous queries via the history panel:

  1. Click "History" in sidebar
  2. Browse recent queries
  3. Click to load into editor
  4. Edit and re-execute

History is stored locally and persists across sessions.

Query Templates

Common query patterns:

Select All

SELECT * FROM {table} LIMIT 100;

Count Rows

SELECT COUNT(*) FROM {table};

Find by ID

SELECT * FROM {table} WHERE id = {id};

Join Tables

SELECT 
  a.*,
  b.name as related_name
FROM {table_a} a
JOIN {table_b} b ON a.{fk} = b.id
LIMIT 100;

Group and Count

SELECT 
  {column},
  COUNT(*) as count
FROM {table}
GROUP BY {column}
ORDER BY count DESC;

Keyboard Shortcuts

ShortcutAction
Ctrl+EnterExecute query
Ctrl+Shift+EnterExecute selection
Ctrl+SSave to history
Ctrl+/Toggle comment
Ctrl+DSelect next occurrence
Alt+Up/DownMove line up/down
Ctrl+Shift+KDelete line
Ctrl+SpaceTrigger autocomplete

Settings

Font Size

Adjust editor font size in Settings.

Theme

Editor follows app theme (dark/light).

Tab Size

Configure indentation (default: 2 spaces).

Word Wrap

Toggle line wrapping for long queries.

Tips

Format SQL

Use online formatters or install:

npm install -g sql-formatter

Explain Queries

Analyze query performance:

EXPLAIN ANALYZE
SELECT * FROM users
WHERE email LIKE '%@example.com';

Transaction Testing

Test changes without committing:

BEGIN;
UPDATE users SET name = 'Test' WHERE id = 1;
SELECT * FROM users WHERE id = 1;
ROLLBACK;

Parameterized Queries

Use $1, $2 syntax for parameters (SDK handles this):

SELECT * FROM users WHERE email = $1 AND active = $2;