A simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.
bunx dbcat ./data.dbConnect to a database to browse all tables:
# No argument - uses DATABASE_URL environment variable
bunx dbcat
# SQLite
bunx dbcat ./database.sqlite
bunx dbcat https://example.com/data.db
# PostgreSQL
bunx dbcat postgres://user:pass@localhost:5432/mydb
# MySQL
bunx dbcat mysql://user:pass@localhost:3306/mydbRun a query by piping SQL:
echo "SELECT * FROM users" | bunx dbcat ./data.db| Flag | Description |
|---|---|
--full, -f |
Show all rows & data when browsing tables (default: 100 rows) |
--json |
Output as JSON (indented if TTY) |
--json=color |
Output as normal object console.log |
Piped queries always return all rows.
$ bunx dbcat ./demo.sqlite
Connected to demo.sqlite
╭─ users ────────────┬───────────────────┬─────────────────────╮
│ id │ name │ email │ created_at │
├────┼───────────────┼───────────────────┼─────────────────────┤
│ 1 │ Alice Johnson │ [email protected] │ 2025-12-08 05:25:21 │
│ 2 │ Bob Smith │ [email protected] │ 2025-12-08 05:25:21 │
│ 3 │ Carol White │ [email protected] │ 2025-12-08 05:25:21 │
│ ... 47 more rows │
╰──────────────────────────────────────────────────────────────╯Pipe to less -R for scrollable output with colors:
bunx dbcat ./data.db --full | less -RDo these things to make git use dbcat to diff your sqlite databases:
# .gitattributes
*.sqlite binary diff=dbcat
*.db binary diff=dbcatgit config diff.lockb.textconv "bunx dbcat --full"
git config diff.lockb.binary trueAnd now you should be able to use
git diff ./data.dbBun v1.3+