Query Editor
Writing Queries
Use the query editor to write and execute SQL queries.
Opening the Editor
Open a new query tab with ⌘ + T or click the + button in the tab bar.
Executing Queries
| Action | Shortcut |
|---|---|
| Run query | ⌘ + Enter |
| Run selected text | Select text, then ⌘ + Enter |
| Run all queries | ⌘ + Shift + Enter |
Multiple Statements
Separate multiple SQL statements with semicolons. Relay will execute them in order and show results for each.
SELECT * FROM users LIMIT 10;
SELECT count(*) FROM orders;Results
Query results appear in a table below the editor. You can:
- Resize columns by dragging headers
- Copy cells or rows with
⌘ + C - Export results to CSV or JSON
AI Assistance
If you have AI enabled, you can type / to trigger the AI helper. This will show up under the query and automatically pull the context of the query editor. It also provides a shortcut to optimize the query.
If your query runs into errors, you can trigger AI-auto-fix with `SHIFT+CMD+E".