sqlitlisted
Install: claude install-skill vanducng/skills
# sqlit
Scriptable CLI for ad-hoc SQL against any saved connection.
## When to use
- "Run this SQL on `<connection>`" / "show me 10 rows of X" / "count rows in Y"
- "What tables / columns are in Z?"
- "Export Z as JSON/CSV"
- Any task naming a connection that appears in `sqlit connections list`
**Never run bare `sqlit`** — it launches a TUI and hijacks the terminal.
## Discover connections
```bash
sqlit connections list # name | type | host:port/db | auth
sqlit connections list --format json # full structured (host, port, default db, tunnel, options)
```
If the named connection isn't listed, **stop and ask** — don't substitute.
## Run a query
```bash
sqlit query -c <CONN> -q '<SQL>' --format <table|csv|json> [-d <db>] [--limit N]
```
| Flag | Purpose | Default |
|------|---------|---------|
| `-c, --connection` | Saved connection name (required) | — |
| `-q, --query` / `-f, --file` | Inline SQL / SQL file path | — |
| `-d, --database` | Override connection's default database | — |
| `-o, --format` | `table` \| `csv` \| `json` | `table` |
| `-l, --limit` | Max rows (`0` = unlimited) | `1000` |
## ⚠ Shell-quoting (CRITICAL)
Wrap SQL in **single quotes** when it contains backticks (BigQuery, MySQL).
Backticks inside double quotes trigger shell command substitution and the
query never reaches sqlit.
```bash
# ✅
sqlit query -c bq -q 'SELECT * FROM `dataset`.`table` LIMIT 10' --format json
# ❌ shell tries to execute `dataset` and `table`
sqlit query -c