Skip to content

Commit 8bbbd8a

Browse files
init
1 parent ed6deda commit 8bbbd8a

File tree

12 files changed

+94
-291
lines changed

12 files changed

+94
-291
lines changed

.claude/settings.local.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
"Bash(timeout 3 bin/r2sql-shell-macos:*)",
2424
"Bash(timeout 2 /Users/mselwan/Documents/r2sql-shell/bin/r2sql-shell-macos:*)",
2525
"Bash(timeout 2 bin/r2sql-shell-macos:*)",
26-
"Bash(timeout 2 ./bin/r2sql-shell-macos:*)"
26+
"Bash(timeout 2 ./bin/r2sql-shell-macos:*)",
27+
"Bash(npm run build:macos:*)",
28+
"Bash(npm run:*)"
2729
],
2830
"deny": [],
2931
"ask": []

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ npm-debug.log*
2525

2626
# History
2727
.r2sql_history
28-
r2-sql-history.txt
28+
r2sql-history.txt
2929
r2sql-debug.log
3030

3131
#Testing/debugging

PUBLISH_CHECKLIST.md

Lines changed: 0 additions & 227 deletions
This file was deleted.

README.md

Lines changed: 20 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
# R2 SQL Shell
22

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+
<div align="center">
44

5-
## Features
5+
![logo](images/logo.png)
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+
<div align="center">
12+
13+
![Demo](images/demo.gif)
614

7-
### TUI Mode (Default)
15+
</div>
16+
17+
## Features
818
- **Split-pane interface** with sidebar and main workspace
919
- **Vim-style navigation** with navigation/insert modes and h/j/k/l keys
1020
- **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
1727
- **Syntax formatting** (Ctrl+F to format SQL)
1828
- **Query history** with quick access (Alt+4)
1929

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-
2730
## Prerequisites
2831

2932
- Node.js 18 or higher
@@ -158,7 +161,8 @@ Options:
158161
--bucket <name> R2 Bucket Name
159162
--token <token> Cloudflare API Token
160163
-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)
162166
--tui Use TUI mode (default)
163167
--simple Use simple REPL mode instead of TUI
164168
-h, --help List of commands
@@ -185,7 +189,7 @@ r2sql --simple
185189

186190
# Combine options
187191
r2sql --account-id YOUR_ID --bucket YOUR_BUCKET --token YOUR_TOKEN \
188-
-e "SELECT * FROM logs LIMIT 5" --history
192+
-e "SELECT * FROM default.logs LIMIT 5" --history
189193
```
190194

191195
### First Time Setup
@@ -296,36 +300,14 @@ In TUI mode, write queries in the editor and press `Ctrl+E`:
296300
```sql
297301
-- Simple SELECT (type in query editor, press Ctrl+E)
298302
SELECT * FROM my_namespace.my_table LIMIT 10;
299-
300-
-- Aggregations
301-
SELECT status, COUNT(*) as count
302-
FROM my_namespace.my_table
303-
GROUP BY status;
304-
305-
-- Filtering
306-
SELECT * FROM my_namespace.my_table
307-
WHERE created_at > '2024-01-01'
308-
ORDER BY created_at DESC;
309303
```
304+
Remember to consult the current R2 SQL limitations
310305

311306
In simple mode, just type and press Enter:
312307

313308
```sql
314309
r2sql> SELECT * FROM my_namespace.my_table LIMIT 10;
315310
```
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-
329311
## R2 SQL Limitations
330312

331313
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:
336318

337319
See the [R2 SQL documentation](https://developers.cloudflare.com/r2-sql/reference/limitations-best-practices/) for details.
338320

321+
339322
## Development
340323

341324
```bash
@@ -432,10 +415,6 @@ If the TUI doesn't render correctly:
432415
- Some terminal emulators may capture certain key combinations
433416
- Try using alternative keys (e.g., if Alt+2 doesn't work, focus the query editor with `h` then `l`)
434417

435-
**Namespaces not loading**
436-
- Check your API token has correct permissions
437-
- Run `node test-connection.js` to verify connectivity
438-
439418
## Built With
440419

441420
- [TypeScript](https://www.typescriptlang.org/)
@@ -448,7 +427,7 @@ If the TUI doesn't render correctly:
448427

449428
## Contributing
450429

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.
452431

453432
## License
454433

@@ -458,4 +437,4 @@ MIT
458437

459438
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`.
460439

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.

images/demo.gif

2.33 MB
Loading

images/logo.png

68.1 KB
Loading

0 commit comments

Comments
 (0)