anitnilay20 / anitnilay20/thoth

SQL query editor UI for file viewer

Offen
#149 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
feature size:medium ux
Vorherrschende Sprache
Rust
Sterne
70
Forks
5
Ø Merge
10 Std. 33 Min.
Gemergte PRs (30 T.)
2

Beschreibung

## 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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.