Query Editor
The Query Editor at frontend/data-workbench/src/components/QueryEditor/ provides a full SQL development environment with schema-aware autocomplete, results grid, and query history.
Components
| Component | File | Purpose |
|---|---|---|
QueryEditor (index) | index.tsx | Main layout container |
SqlEditor | SqlEditor.tsx | SQL input with Monaco Editor |
ResultsGrid | ResultsGrid.tsx | Tabular results display |
QueryHistory | QueryHistory.tsx | Recent query list |
SqlEditor
Uses the shared SqlEditor component from @matih/shared with data-workbench-specific schema integration:
- Schema metadata loaded from the active data source
- Autocomplete for tables, columns, and functions
- Ctrl+Enter to execute
- Error markers from SQL validation
ResultsGrid
Features:
- Sortable columns
- Column resizing
- Cell value copy
- Export to CSV/JSON
- Row count and execution time display
- Pagination for large result sets
QueryHistory
Displays recent queries with:
- SQL preview
- Execution time
- Row count
- Status (success/error)
- Quick re-run
- Save to favorites