A simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.
npm install dbcatdbcatA simple CLI to view database tables. Supports PostgreSQL, MySQL, and SQLite.
``sh`
bunx dbcat ./data.db
Connect to a database to browse all tables:
`shNo argument - uses DATABASE_URL environment variable
bunx dbcat
Run a query by piping SQL:
`sh
echo "SELECT * FROM users" | bunx dbcat ./data.db
`$3
| 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.
Example
`sh
$ bunx dbcat ./demo.sqlite
Connected to demo.sqlite╭─ users ────────────┬───────────────────┬─────────────────────╮
│ id │ name │ email │ created_at │
├────┼───────────────┼───────────────────┼─────────────────────┤
│ 1 │ Alice Johnson │ alice@example.com │ 2025-12-08 05:25:21 │
│ 2 │ Bob Smith │ bob@example.com │ 2025-12-08 05:25:21 │
│ 3 │ Carol White │ carol@example.com │ 2025-12-08 05:25:21 │
│ ... 47 more rows │
╰──────────────────────────────────────────────────────────────╯
`$3
Pipe to
less -R for scrollable output with colors:`sh
bunx dbcat ./data.db --full | less -R
`$3
Do these things to make git use
dbcat to diff your sqlite databases:`sh
.gitattributes
*.sqlite binary diff=dbcat
*.db binary diff=dbcat
``sh
git config diff.lockb.textconv "bunx dbcat --full"
git config diff.lockb.binary true
`And now you should be able to use
`sh
git diff ./data.db
``Bun v1.3+