duckdb-terminal 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -1
- package/dist/duckdb-terminal.js +1106 -1030
- package/dist/duckdb-terminal.umd.cjs +15 -14
- package/dist/lib.d.ts +246 -69
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
A browser-based SQL Terminal for [DuckDB](https://duckdb.org/) powered by [Ghostty](https://ghostty.org/) terminal emulator.
|
|
4
4
|
|
|
5
|
+
## Try it live
|
|
6
|
+
The latest version is always deployed to [https://terminal.sql-workbench.com](https://terminal.sql-workbench.com).
|
|
7
|
+
|
|
8
|
+
## API Docs
|
|
9
|
+
The TypeScript API Docs can be found at [https://tobilg.github.io/duckdb-terminal](https://tobilg.github.io/duckdb-terminal/).
|
|
10
|
+
|
|
5
11
|
## Features
|
|
6
12
|
|
|
7
13
|
- **Full SQL REPL** - Execute SQL queries with multi-line support
|
|
@@ -19,6 +25,56 @@ A browser-based SQL Terminal for [DuckDB](https://duckdb.org/) powered by [Ghost
|
|
|
19
25
|
- **Query Timing** - Optional execution time display
|
|
20
26
|
- **Persistent Storage** - Optional OPFS storage for data persistence
|
|
21
27
|
|
|
28
|
+
## Architecture
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
32
|
+
│ Browser │
|
|
33
|
+
├─────────────────────────────────────────────────────────────────────────────┤
|
|
34
|
+
│ │
|
|
35
|
+
│ ┌───────────────────────────────────────────────────────────────────────┐ │
|
|
36
|
+
│ │ DuckDB Terminal │ │
|
|
37
|
+
│ │ │ │
|
|
38
|
+
│ │ ┌─────────────────────────────────────────────────────────────────┐ │ │
|
|
39
|
+
│ │ │ Terminal │ │ │
|
|
40
|
+
│ │ │ │ │ │
|
|
41
|
+
│ │ │ - REPL (input, output, history) │ │ │
|
|
42
|
+
│ │ │ - Command parsing (SQL, dot commands, multi-line) │ │ │
|
|
43
|
+
│ │ │ - Result formatting (table, CSV, TSV, JSON) │ │ │
|
|
44
|
+
│ │ │ - Syntax highlighting │ │ │
|
|
45
|
+
│ │ └───────┬─────────────────────┬─────────────────────────┬─────────┘ │ │
|
|
46
|
+
│ │ │ │ │ │ │
|
|
47
|
+
│ │ ▼ ▼ │ │ │
|
|
48
|
+
│ │ ┌───────────────┐ ┌─────────────────────┐ │ │ │
|
|
49
|
+
│ │ │ Terminal │ │ Database │ │ │ │
|
|
50
|
+
│ │ │ Adapter │ │ │ │ │ │
|
|
51
|
+
│ │ │ │ │ - DuckDB WASM │ │ │ │
|
|
52
|
+
│ │ │ - Ghostty │ │ wrapper │ │ │ │
|
|
53
|
+
│ │ │ - Themes │ │ - Query execution │ │ │ │
|
|
54
|
+
│ │ │ - Keyboard │ │ - Auto-complete │ │ │ │
|
|
55
|
+
│ │ │ - Mobile │ │ - File loading │ │ │ │
|
|
56
|
+
│ │ └───────┬───────┘ └─────────┬───────────┘ │ │ │
|
|
57
|
+
│ │ │ │ │ │ │
|
|
58
|
+
│ └──────────┼─────────────────────┼─────────────────────────┼────────────┘ │
|
|
59
|
+
│ │ │ │ │
|
|
60
|
+
│ ▼ ▼ ▼ │
|
|
61
|
+
│ ┌────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ │
|
|
62
|
+
│ │ Ghostty Web │ │ DuckDB WASM │ │ IndexedDB │ │
|
|
63
|
+
│ │ (npm package) │ │ (Web Worker) │ │ (Command History) │ │
|
|
64
|
+
│ │ │ │ │ │ │ │
|
|
65
|
+
│ │ - Canvas rendering │ │ - SQL engine │ └─────────────────────┘ │
|
|
66
|
+
│ │ - VT100 emulation │ │ - Query processing │ │
|
|
67
|
+
│ └────────────────────┘ └──────────┬──────────┘ │
|
|
68
|
+
│ │ │
|
|
69
|
+
│ ▼ │
|
|
70
|
+
│ ┌─────────────────────┐ │
|
|
71
|
+
│ │ OPFS │ │
|
|
72
|
+
│ │ (Database Storage) │ │
|
|
73
|
+
│ └─────────────────────┘ │
|
|
74
|
+
│ │
|
|
75
|
+
└─────────────────────────────────────────────────────────────────────────────┘
|
|
76
|
+
```
|
|
77
|
+
|
|
22
78
|
## Installation
|
|
23
79
|
|
|
24
80
|
```bash
|
|
@@ -116,14 +172,29 @@ interface TerminalConfig {
|
|
|
116
172
|
|-----|--------|
|
|
117
173
|
| `Enter` | Execute command/SQL |
|
|
118
174
|
| `Tab` | Auto-complete |
|
|
175
|
+
| `Backspace` | Delete character before cursor |
|
|
176
|
+
| `Delete` | Delete character at cursor |
|
|
119
177
|
| `↑` / `↓` | Navigate history |
|
|
120
178
|
| `←` / `→` | Move cursor |
|
|
179
|
+
| `Home` | Move to start of line |
|
|
180
|
+
| `End` | Move to end of line |
|
|
121
181
|
| `Ctrl+A` | Move to start of line |
|
|
122
182
|
| `Ctrl+E` | Move to end of line |
|
|
123
|
-
| `Ctrl+K` | Clear to end of line |
|
|
183
|
+
| `Ctrl+K` | Clear from cursor to end of line |
|
|
124
184
|
| `Ctrl+U` | Clear entire line |
|
|
185
|
+
| `Ctrl+V` | Paste from clipboard |
|
|
125
186
|
| `Ctrl+C` | Cancel current input |
|
|
126
187
|
|
|
188
|
+
### Pagination Mode
|
|
189
|
+
|
|
190
|
+
When viewing paginated results, the following keys are available:
|
|
191
|
+
|
|
192
|
+
| Key | Action |
|
|
193
|
+
|-----|--------|
|
|
194
|
+
| `n` / `↓` / `Enter` | Next page |
|
|
195
|
+
| `p` / `↑` | Previous page |
|
|
196
|
+
| `q` / `Escape` / `Ctrl+C` | Quit pagination |
|
|
197
|
+
|
|
127
198
|
## Example Usage
|
|
128
199
|
|
|
129
200
|
```sql
|