You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-41Lines changed: 20 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,20 @@
1
1
# R2 SQL Shell
2
2
3
-
An interactive TUI (Text User Interface) for querying R2 Data Catalog using R2 SQL. Built with TypeScript and featuring vim-style keyboard navigation.
3
+
<divalign="center">
4
4
5
-
## Features
5
+

6
+
7
+
</div>
8
+
9
+
An interactive TUI (Text User Interface) for querying R2 Data Catalog using R2 SQL. Built with TypeScript and featuring vim-style keyboard navigation. UI inspiration from [rainfrog](https://github.com/achristmascarl/rainfrog) - an excellent SQL client with a beautiful TUI. When R2 SQL becomes more feature complete, there's a good chance I'll create a driver for rainfrog.
10
+
11
+
<divalign="center">
12
+
13
+

6
14
7
-
### TUI Mode (Default)
15
+
</div>
16
+
17
+
## Features
8
18
-**Split-pane interface** with sidebar and main workspace
9
19
-**Vim-style navigation** with navigation/insert modes and h/j/k/l keys
10
20
-**Expandable tree view** for namespaces and tables
@@ -17,13 +27,6 @@ An interactive TUI (Text User Interface) for querying R2 Data Catalog using R2 S
17
27
-**Syntax formatting** (Ctrl+F to format SQL)
18
28
-**Query history** with quick access (Alt+4)
19
29
20
-
### Simple Mode (--simple flag)
21
-
-**Traditional REPL** with readline interface
22
-
-**Auto-completion** for SQL keywords, namespaces, and tables
23
-
-**Query history** stored locally for easy recall
24
-
-**Smart formatting** with nicely formatted tables
25
-
-**Query metadata** showing row counts, execution time, and bytes scanned
26
-
27
30
## Prerequisites
28
31
29
32
- Node.js 18 or higher
@@ -158,7 +161,8 @@ Options:
158
161
--bucket <name> R2 Bucket Name
159
162
--token <token> Cloudflare API Token
160
163
-e, --execute <query> Execute a SQL query on startup
161
-
--history [enabled] Save query history to r2-sql-history.txt (default: false)
164
+
--history [enabled] Save query history to r2sql-history.txt (default: false)
165
+
--debug Enable debug logging to r2sql-debug.log (default: false)
@@ -296,36 +300,14 @@ In TUI mode, write queries in the editor and press `Ctrl+E`:
296
300
```sql
297
301
-- Simple SELECT (type in query editor, press Ctrl+E)
298
302
SELECT*FROMmy_namespace.my_tableLIMIT10;
299
-
300
-
-- Aggregations
301
-
SELECT status, COUNT(*) as count
302
-
FROMmy_namespace.my_table
303
-
GROUP BY status;
304
-
305
-
-- Filtering
306
-
SELECT*FROMmy_namespace.my_table
307
-
WHERE created_at >'2024-01-01'
308
-
ORDER BY created_at DESC;
309
303
```
304
+
Remember to consult the current R2 SQL limitations
310
305
311
306
In simple mode, just type and press Enter:
312
307
313
308
```sql
314
309
r2sql>SELECT*FROMmy_namespace.my_tableLIMIT10;
315
310
```
316
-
317
-
### Features in Action
318
-
319
-
**Auto-completion**: Press TAB to auto-complete SQL keywords, table names, and namespaces.
320
-
321
-
**Query History**: Use UP/DOWN arrow keys to navigate through your query history.
322
-
323
-
**Automatic Charts**: The shell will automatically display charts for:
324
-
- Time series data (date/time column + numeric values)
325
-
- Categorical data (text column + numeric values)
326
-
327
-
**Helpful Error Messages**: Errors include suggestions based on common issues.
328
-
329
311
## R2 SQL Limitations
330
312
331
313
R2 SQL has some limitations compared to standard SQL. Be aware of:
@@ -336,6 +318,7 @@ R2 SQL has some limitations compared to standard SQL. Be aware of:
336
318
337
319
See the [R2 SQL documentation](https://developers.cloudflare.com/r2-sql/reference/limitations-best-practices/) for details.
338
320
321
+
339
322
## Development
340
323
341
324
```bash
@@ -432,10 +415,6 @@ If the TUI doesn't render correctly:
432
415
- Some terminal emulators may capture certain key combinations
433
416
- Try using alternative keys (e.g., if Alt+2 doesn't work, focus the query editor with `h` then `l`)
434
417
435
-
**Namespaces not loading**
436
-
- Check your API token has correct permissions
437
-
- Run `node test-connection.js` to verify connectivity
438
-
439
418
## Built With
440
419
441
420
-[TypeScript](https://www.typescriptlang.org/)
@@ -448,7 +427,7 @@ If the TUI doesn't render correctly:
448
427
449
428
## Contributing
450
429
451
-
Contributions are welcome! Please feel free to submit a Pull Request.
430
+
Contributions are welcome! Please feel free to submit a Pull Request/Issues.
452
431
453
432
## License
454
433
@@ -458,4 +437,4 @@ MIT
458
437
459
438
This project was built with [Claude Code](https://claude.com/claude-code), Anthropic's agentic coding tool. The development process and architecture decisions are documented in `CLAUDE.md`.
460
439
461
-
UI inspiration from [rainfrog](https://github.com/achristmascarl/rainfrog) - an excellent SQL client with a beautiful TUI.
440
+
UI inspiration from [rainfrog](https://github.com/achristmascarl/rainfrog) - an excellent SQL client with a beautiful TUI. When R2 SQL becomes more feature complete, there's a good chance I'll create a driver for rainfrog.
0 commit comments