dbcat
v0.0.10
Published
A simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.
Maintainers
Readme
dbcat
A simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.
bunx dbcat ./data.dbUsage
Connect 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.dbOptions
| Flag | Description |
|----------------|---------------------------------------------------|
| --full, -f | Show all rows when browsing tables (default: 100) |
| --json | Output as JSON (indented if TTY) |
| --json=color | Output as normal object console.log |
Piped queries always return all rows.
Example
$ 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 │
╰──────────────────────────────────────────────────────────────╯Scrollable Output
Pipe to less -R for scrollable output with colors:
bunx dbcat ./data.db --full | less -RGit diffable
Do 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.dbRequirements
Bun v1.3+
