tidyql-rs is a terminal-based application for browsing and formatting SQL files. It provides a user interface to navigate through files, view their content, and format SQL files with syntax highlighting.
- Browse files in the current directory
- View file content with syntax highlighting
- Format SQL files with customizable options
- Save formatted SQL files
- Notifications for actions
To install and run tidyql-rs, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/tidyql-rs.git cd tidyql-rs
-
Build the project:
cargo build --release
-
Run the application:
cargo run --release
q
: Quit the applicationDown Arrow
: Move down in the file listUp Arrow
: Move up in the file listf
: Format the selected SQL files
: Save the formatted SQL file
The user interface is divided into three main sections:
- File Browser: Located on the left side, this section displays the list of files in the current directory. Use the arrow keys to navigate through the files.
- File Content: Located on the right side, this section displays the content of the selected file with syntax highlighting. If the file is an SQL file and has been formatted, the formatted content will be displayed.
- Commands: Located at the bottom, this section displays the available commands.
Notifications are displayed at the top right corner of the screen to inform you about the status of actions such as formatting and saving files.
- ratatui: A Rust library for building terminal user interfaces
- syntect: A Rust library for syntax highlighting
Contributions are welcome! Please open an issue or submit a pull request on GitHub.