tdb

A terminal-based database IDE supporting 9 backends: PostgreSQL, MySQL, SQLite, MongoDB, Redis, S3, BoltDB, BadgerDB, and LevelDB.
Features
- Multi-tab connections with session isolation
- Explorer panel with tree navigation (expand/collapse, filter, lazy-load children)
- SQL/query editor with syntax highlighting and tab-completion
- Results panel (table view, JSON view, key-value view)
- Mouse support: click to focus panels, click tree nodes, scroll with mouse wheel
- Keyboard-driven workflow with vim-style navigation
- Connection dialog for interactive setup
- Help overlay (press F1)
Installation
curl -sfL https://raw.githubusercontent.com/mitchmyburgh/tdb/main/install.sh | sh
Or build from source:
go build ./cmd/tdb/
Or using Make:
make build
Usage
# Launch with connection dialog
./tdb
# Connect directly via DSN
./tdb --type sqlite --dsn ":memory:"
./tdb --type postgres --dsn "postgres://user:pass@localhost:5432/mydb?sslmode=disable"
./tdb --type redis --dsn "redis://localhost:6379/0"
# Auto-detect type from DSN scheme
./tdb "mongodb://localhost:27017/testdb"
# Named connection tab
./tdb --type mysql --dsn "root@tcp(localhost:3306)/app" --name "prod-db"
Supported Databases
| Database |
Type flag |
Default Port |
DSN Example |
| PostgreSQL |
postgres |
5432 |
postgres://user:pass@host:5432/db |
| MySQL |
mysql |
3306 |
user:pass@tcp(host:3306)/db |
| SQLite |
sqlite |
— |
:memory: or /path/to/file.db |
| MongoDB |
mongodb |
27017 |
mongodb://host:27017/db |
| Redis |
redis |
6379 |
redis://localhost:6379/0 |
| S3 |
s3 |
— |
s3://region/bucket |
| BoltDB |
bolt |
— |
/path/to/bolt.db |
| BadgerDB |
badger |
— |
/path/to/badger-dir |
| LevelDB |
leveldb |
— |
/path/to/leveldb-dir |
Keyboard Shortcuts
| Key |
Action |
Ctrl+T |
New connection |
Ctrl+W |
Close tab |
Ctrl+E |
Execute query |
Tab |
Cycle focus between panels |
j/k |
Navigate up/down |
g/G |
Jump to first/last |
h/l |
Collapse/expand (explorer), left/right (table) |
/ |
Search/filter |
y |
Copy selected value |
F1 |
Toggle help overlay |
Esc |
Cancel/clear |
Ctrl+C |
Quit |
Mouse Interactions
- Click tab bar to switch tabs
- Click explorer tree nodes to expand/select
- Click results rows to select
- Scroll wheel to navigate explorer, results, and editor
Running Tests
make test
# or
go test ./...