anitnilay20 / anitnilay20/thoth
SQL query editor UI for file viewer
- Lingua principale
- Rust
- Stelle
- 70
- Fork
- 5
- Merge medio
- 10h 33m
- PR unite (30g)
- 2
Descrizione
## Context
UI layer for the DuckDB file query engine epic (#147). Depends on #148 (FileQueryEngine). Surfaces DuckDB's query capabilities to the user without requiring them to know SQL syntax upfront.
## What to build
A query bar that appears below the file viewer toolbar when a file is open. Two modes — toggled by a button:
**Raw mode** (default): existing lazy scroll behaviour, file-loader plugin drives the view.
**Query mode**: user types SQL, hits Run (or ⌘↵), results render via `dataset-bus` → `data-view`.
### Layout
```
┌─────────────────────────────────────────────────────────┐
│ [Raw ↔ Query] SELECT * FROM data WHERE price > 100 │
│ ORDER BY created_at DESC [Run] │
├─────────────────────────────────────────────────────────┤
│ ┌──────────┬──────────┬──────────────┐ │
│ │ name │ price │ created_at │ │
│ ├──────────┼──────────┼──────────────┤ │
│ │ Widget A │ 149.99 │ 2026-07-01 │ │
│ └──────────┴──────────┴──────────────┘ │
│ 42 rows · 12ms │
└─────────────────────────────────────────────────────────┘
```
### Details
- Query input: multi-line `TextEdit`, monospace font, reasonable min-height
- Run shortcut: ⌘↵ (macOS) / Ctrl+↵
- Status line: row count + execution time, or error message in red
- Results: published to `dataset-bus`, rendered via existing `data-view` node — no new table widget needed
- Column schema from `FileQueryEngine::schema()` available for future autocomplete
- Query persists per tab across mode switches (don't clear when toggling back to raw)
- Default query pre-filled as `SELECT * FROM data LIMIT 1000` on first open
## Acceptance criteria
- [ ] Mode toggle button in file viewer toolbar
- [ ] SQL input with ⌘↵ / Ctrl+↵ run shortcut
- [ ] Results render through existing data-view (no new table implementation)
- [ ] Row count and query time shown in status line
- [ ] Errors shown inline below the editor (not a modal)
- [ ] Query string preserved when switching back to raw mode
- [ ] Works for all formats supported by FileQueryEngine
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.