DFox is a Rust-based database management tool that provides a terminal user interface (TUI) for interacting with PostgreSQL and MySQL databases. It allows users to perform database operations easily and efficiently through a simple and intuitive interface.
- Connect to multiple database types: PostgreSQL, MySQL, (SQLite still in development).
- User-friendly terminal interface for managing database connections and performing CRUD operations.
- Dynamic rendering of database schemas and table data.
- Easily extendable for additional database types and features.
The project is organized as a Cargo workspace consisting of two main components:
- dfox-core: The core library responsible for database operations. It includes implementations for MySQL, PostgreSQL, and SQLite clients, as well as data models and error handling.
- dfox-tui: The command-line interface for user interaction. It contains the main functions for launching the application, along with UI components and event handlers.
-
Database Type Selection
Upon starting the application, the user is presented with a menu to select the database type (PostgreSQL, MySQL, or SQLite). Use the up/down keys to navigate and Enter to confirm your choice.
-
Connection Input Screen
After selecting the database type, the user is prompted to input the connection details such as hostname, port, username, and password.
-
Database Selection
Once connected, a list of available databases is displayed. The user can choose the database to interact with.
-
Table View
The application dynamically renders the list of tables available in the selected database.
-
Describe Table
The user can select a table to view its schema, displayed in a tree-like structure, including column names, types, and constraints.
-
Query Execution and Results
The user can execute SQL queries and view the results in the TUI.
-
Error Handling
If there is an error with the query or database operation, an error message is displayed in the interface.
To build and run the project, ensure you have Rust installed. Clone the repository and use Cargo to build the project:
git clone https://github.com/markraiter/dfox.git
cd dfox
cargo build
After building the project, you can run the TUI application with the following command:
cargo run --bin dfox-tui
Contributions are welcome! If you would like to contribute to DFox, please follow these steps:
- Fork the repository.
- Create your feature branch (git checkout -b feature/my-feature).
- Commit your changes (git commit -m 'Add some feature').
- Push to the branch (git push origin feature/my-feature).
- Open a pull request.
Thanks to the Ukrainian Rust Community for their incredible support and resources.