A modern terminal-based database client written in Rust. FerrumDB provides an intuitive TUI (Text User Interface) for interacting with your databases.
- 🖥️ Modern terminal user interface using ratatui
- ⌨️ Vim-like modal editing (Normal and Insert modes)
- 📝 Interactive SQL query editor with cursor support
- 🎨 Multi-panel layout:
- Query input panel
- Results display in table format
- Database navigation sidebar
- Status bar showing current connection
- ⚙️ Configuration file support (config.toml)
- 🔍 Query execution and results display
- 📊 Table view for query results
- Database schema navigation
- Query history
- Syntax highlighting
- Auto-completion
- Multiple database backend support
- Keyboard shortcuts customization
- Results pagination
- Column sorting
Currently, the project is under development. To try it out:
# Clone the repository
git clone https://github.com/louire/ferrum_db.git
cd ferrum_db
# Create a config.toml file
cat > config.toml << EOL
[database]
host = "localhost"
port = 5432
username = "your_username"
password = "your_password"
database = "your_database"
EOL
# Build the project
cargo build
# Run in debug mode
cargo run
Create a config.toml
file in the project root with your database connection details:
[database]
host = "localhost"
port = 5432
username = "postgres"
password = "your_password"
database = "your_database"
If no configuration file is found, a default one will be created.
i
- Enter Insert modeq
- Quit applicationCtrl+C
- Quit applicationr
- Clear resultsd
- Toggle database list (coming soon)
Esc
- Return to Normal modeEnter
- Execute query and return to Normal modeCtrl+Enter/Alt+Enter
- Execute query and stay in Insert mode←/→
- Move cursorBackspace
- Delete character before cursorDelete
- Delete character under cursorHome/Ctrl+a
- Move to start of lineEnd/Ctrl+e
- Move to end of line
ferrum_db/
├── src/
│ ├── main.rs # Application entry point
│ ├── app/ # Application logic
│ │ ├── mod.rs # App struct and event handling
│ │ ├── state.rs # Application state management
│ │ ├── input.rs # Input handling and modes
│ │ └── query.rs # Query result handling
│ ├── config/ # Configuration handling
│ │ └── mod.rs # Configuration loading/saving
│ ├── database/ # Database interaction
│ │ ├── mod.rs # Database connection and queries
│ │ └── error.rs # Custom error types
│ └── ui/ # User interface
│ ├── mod.rs # UI layout and rendering
│ ├── input.rs # Query input panel
│ ├── results.rs # Query results panel
│ ├── sidebar.rs # Navigation sidebar
│ ├── status.rs # Status bar
│ └── table.rs # Table rendering component
The project is in active development. Current focus is on:
- Implementing database schema navigation
- Adding query history
- Adding syntax highlighting
- Implementing auto-completion
The project is in early development stages. Contributions are welcome! Please feel free to submit issues and pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- ratatui - For the terminal user interface framework
- sqlx - For the SQL toolkit
- crossterm - For terminal manipulation
- config-rs - For configuration management
Built with 🦀 Rust and ❤️