A terminal user interface (TUI) for PostgreSQL database management, built with Go and Bubbletea.
- Split-pane interface: Database/table tree navigation on the left, content viewer on the right
- Database tree viewer: Browse databases, schemas, and tables
- Table viewer: View and browse table data with scrolling support
- Query editor: Write and execute SQL queries with syntax highlighting
- Keyboard-driven: Navigate and interact entirely via keyboard
go install github.com/SavingFrame/dbettier@latestOr build from source:
git clone https://github.com/SavingFrame/dbettier.git
cd dbettier
go builddbettier [connection-string]Example:
dbettier "postgres://user:password@localhost:5432/dbname"| Key | Action |
|---|---|
Tab |
Switch focus between tree and content pane |
↑/↓ |
Navigate up/down |
Enter |
Select database/table or execute query |
Ctrl+T |
Toggle between table viewer and query editor |
Ctrl+C / q |
Quit application |
The application follows a component-based architecture:
- App Model: Main orchestrator managing focus and state
- DB Tree Component: Interactive database/table navigation
- Table Viewer Component: Display table data with scrolling
- Query Editor Component: SQL query editor with execution
- Status Bar Component: Connection status and help text
🚧 Under active development - Core features are being implemented.
- Bubbletea - Terminal UI framework
- Bubbles - TUI components
- Lipgloss - Style and layout
- Go PostgreSQL driver (planned)
The project uses testcontainers-go for integration tests with PostgreSQL.
Option 1: Use testcontainers (default)
go test -v ./...This will automatically spin up a PostgreSQL container, run tests, and clean up.
Option 2: Use existing PostgreSQL instance
# Set environment variables
export TEST_POSTGRES_HOST=localhost
export TEST_POSTGRES_PORT=5432
export TEST_POSTGRES_USER=postgres
export TEST_POSTGRES_PASSWORD=mypassword
export TEST_POSTGRES_DB=postgres
# Run tests (much faster, ~60x)
go test -v ./...Option 3: Use the helper script
# Use testcontainers
./test.sh
# Try to use existing postgres container if running
./test.sh --existing
# Show help
./test.sh --helpContributions are welcome! Please feel free to submit issues or pull requests.
MIT License - see LICENSE file for details
