SQL Editor
PondPilot’s SQL editor is built for productivity with syntax highlighting, intelligent autocomplete, and full DuckDB SQL support.
Editor Features
Section titled “Editor Features”Syntax Highlighting
Section titled “Syntax Highlighting”The editor provides full SQL syntax highlighting powered by CodeMirror:
- Keywords (
SELECT,FROM,WHERE, etc.) - Functions (
COUNT,SUM,AVG, etc.) - Strings, numbers, and comments
- Table and column references
Autocomplete
Section titled “Autocomplete”Start typing to get intelligent suggestions:
- Table names from your data sources
- Column names based on context
- DuckDB functions with signatures
- Keywords and SQL clauses
Press Tab or Enter to accept a suggestion.
Function Tooltips
Section titled “Function Tooltips”Hover over any DuckDB function to see:
- Function signature
- Parameter descriptions
- Return type
- Example usage
Executing Queries
Section titled “Executing Queries”Run Entire Script
Section titled “Run Entire Script”Press Ctrl+Enter (or ⌘+Enter on Mac) to execute all statements in your script.
Multiple statements are executed in order:
-- All three statements run sequentiallyCREATE TABLE temp AS SELECT * FROM data;UPDATE temp SET status = 'processed';SELECT * FROM temp;Run Statement Under Cursor
Section titled “Run Statement Under Cursor”Press Ctrl+Shift+Enter to execute only the statement where your cursor is positioned.
This is useful for:
- Testing individual queries in a larger script
- Re-running a specific statement
- Debugging step by step
Execution Feedback
Section titled “Execution Feedback”After running a query:
- Success - Results appear in the table below
- Error - Error message with line number and details
- Timing - Execution duration displayed
Query Results
Section titled “Query Results”Results Table
Section titled “Results Table”Results display in an interactive table:
| Feature | Description |
|---|---|
| Sort | Click column headers |
| Filter | Filter by column values |
| Paginate | Navigate large result sets |
| Copy | Select and copy cells |
| Resize | Drag column borders |
NULL Values
Section titled “NULL Values”NULL values are clearly indicated with a distinct style, making them easy to distinguish from empty strings.
Data Types
Section titled “Data Types”Column headers show the data type:
name (VARCHAR) | age (INTEGER) | created_at (TIMESTAMP)Editor Customization
Section titled “Editor Customization”Font Settings
Section titled “Font Settings”Customize the editor font in Settings → Appearance:
- Font size - Adjust text size
- Font weight - Light, regular, semibold, or bold
Format on Run
Section titled “Format on Run”Enable automatic SQL formatting when executing queries:
- Open Settings → Appearance
- Toggle “Format on Run”
When enabled, your SQL is automatically formatted before execution.
Script Management
Section titled “Script Management”Creating Scripts
Section titled “Creating Scripts”Create new scripts using:
- Ctrl+K → “New SQL Script”
- Click the + button in the tab bar
- Spotlight → type a name for your script
Naming Scripts
Section titled “Naming Scripts”Click the script name in the tab to rename it. Scripts are auto-saved with their names.
Script Storage
Section titled “Script Storage”Scripts are automatically saved to your browser’s IndexedDB:
- Persistent - Scripts survive browser restarts
- Automatic - No manual save needed
- Per-browser - Scripts are specific to your browser profile
Importing SQL Files
Section titled “Importing SQL Files”Import existing .sql files:
- Press Ctrl+I or Spotlight → “Import SQL Files”
- Select one or more
.sqlfiles - Each file opens as a new script tab
Exporting Scripts
Section titled “Exporting Scripts”Export all your scripts as a ZIP archive:
- Open Settings → Saved Data
- Click “Export All Queries”
- Download the ZIP file
Working with Tabs
Section titled “Working with Tabs”Tab Management
Section titled “Tab Management”- Multiple tabs - Work on multiple scripts simultaneously
- Reorder - Drag tabs to rearrange
- Close - Click the X or middle-click
- Close others - Right-click → “Close Other Tabs”
Tab Types
Section titled “Tab Types”| Tab Type | Icon | Description |
|---|---|---|
| Script | 📝 | SQL query editor |
| Table | 📊 | Data source preview |
| Comparison | ⚖️ | Data comparison results |
Error Handling
Section titled “Error Handling”Syntax Errors
Section titled “Syntax Errors”Errors are highlighted with:
- Red underline on the problematic code
- Error message with line number
- Suggested fix (when available)
Common Errors
Section titled “Common Errors”| Error | Cause | Solution |
|---|---|---|
| Table not found | Table doesn’t exist or isn’t loaded | Check Data Explorer for available tables |
| Column not found | Typo or wrong table | Use autocomplete for column names |
| Syntax error | Invalid SQL | Check DuckDB documentation |
DuckDB SQL Reference
Section titled “DuckDB SQL Reference”PondPilot uses DuckDB, which supports standard SQL plus many extensions:
Useful Functions
Section titled “Useful Functions”-- Read files directlySELECT * FROM read_csv('file.csv');SELECT * FROM read_parquet('file.parquet');SELECT * FROM read_json('file.json');
-- Export resultsCOPY (SELECT * FROM data) TO 'output.parquet';
-- Describe tablesDESCRIBE my_table;SHOW TABLES;
-- String functionsSELECT string_agg(name, ', ') FROM users;
-- Window functionsSELECT *, ROW_NUMBER() OVER (PARTITION BY category) FROM sales;DuckDB Extensions
Section titled “DuckDB Extensions”PondPilot includes common DuckDB extensions:
- parquet - Parquet file support
- json - JSON functions
- excel - Excel file reading
For complete DuckDB SQL reference, see DuckDB Documentation.