Opening the Query Editor
Connect to Database
Select an active database connection from the sidebar. The editor will load schema metadata for autocomplete.
Editor Features
SQL Autocomplete
The editor provides intelligent autocomplete based on your database schema:- Tables and Views: Type table names to see suggestions from the active schema
- Columns: After typing a table name and
., see all columns for that table - Functions: Access database-specific functions (e.g., PostgreSQL functions)
- Procedures: Browse stored procedures and routines
- Keywords: SQL keywords with context-aware suggestions
For PostgreSQL, the editor loads tables from all schemas (not just the active one) to support cross-schema queries.
Code Formatting
Beautify SQL queries with automatic formatting:- Format Selection: Select a portion of SQL and press
Shift+Alt+Fto format just that section - Format All: Press
Cmd+Ior use the Beautify button to format the entire query - Dialect-Aware: Formatting respects the syntax rules of your database type (PostgreSQL, MySQL, etc.)
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Cmd+Enter | Run Current Statement |
Shift+Cmd+Enter | Run All |
Cmd+I | Format SQL |
Shift+Alt+F | Format Selection |
Shift+Cmd+S | Save SQL as File |
Query Execution
Run Modes
Choose between two execution modes:- Run Current
- Run All
Executes the statement under the cursor or the selected text. Perfect for testing individual queries in a multi-statement file.Default shortcut:
Cmd+EnterChange the default run mode by clicking the dropdown arrow next to the Run button and selecting Default → Run Current or Run All.
Query Limits
Control the maximum number of rows returned:- Click the Limit dropdown to select a row limit (100, 500, 1,000, 5,000, etc.)
- Select No limit to return all rows
- The limit is automatically appended to
SELECTqueries - Your limit preference is saved and persists across sessions
Transaction Management
Auto vs Manual Commit
For databases that support transactions (PostgreSQL, MySQL, MariaDB, SQL Server), toggle between:- Auto Commit
- Manual Commit
Each query is committed immediately after execution. This is the default mode for most database tools.
When a transaction is active, an animated indicator appears with the text Transaction active.
Safe Mode
If Safe Mode is enabled for the connection, transaction controls are hidden and all modifications are blocked.Query Results
Results Grid
Query results appear in a data grid below the editor:- Sort: Click column headers to sort ascending/descending
- Select Row: Click a row to view details in the right panel
- Export: Use the status bar export button to save results to CSV, JSON, or SQL
Status Information
The status bar displays:- Row Count: Total rows returned
- Execution Time: How long the query took to execute
- Affected Rows: For
INSERT,UPDATE,DELETEstatements - Error Messages: If the query fails
Saving Queries
Add to Queries
Save frequently used queries to the Queries collection:Export to File
Export the current query to a.sql file:
- Click Run dropdown → Save SQL as…
- Choose a location and filename
- Press
Shift+Cmd+Sas a shortcut
Multi-Statement Queries
Statement Separation
Write multiple statements separated by semicolons:- Run Current executes only the statement under your cursor
- Run All executes all three statements in order
Best Practices
Use Transactions for Data Changes
Use Transactions for Data Changes
When modifying production data, enable Manual Commit mode. Review changes in the results pane before committing.
Test with Limits
Test with Limits
Always add a row limit when exploring unfamiliar tables to avoid accidentally loading millions of rows.
Format for Readability
Format for Readability
Press
Cmd+I before saving queries to the Queries collection. Formatted SQL is easier to maintain.Save Complex Queries
Save Complex Queries
Use Add to Queries for reporting queries, data migrations, and complex JOINs you’ll need again.
Troubleshooting
Autocomplete Not Showing
Autocomplete Not Showing
- Ensure you’re connected to a database
- Check that the database/schema is selected in the sidebar
- For PostgreSQL, verify the active schema contains tables
- Try typing
.after a table name to trigger column suggestions
Query Timeout
Query Timeout
Long-running queries may timeout. Check:
- Database server timeout settings
- Query execution plan (use
EXPLAINto analyze) - Consider adding indexes for slow queries
Transaction Not Committing
Transaction Not Committing
- Look for the Transaction active indicator
- Click Commit to apply changes
- If the tab closes with an active transaction, changes are automatically rolled back