| Crates.io | sqlformater |
| lib.rs | sqlformater |
| version | 1.0.11 |
| created_at | 2025-08-24 12:08:55.556183+00 |
| updated_at | 2025-08-24 12:08:55.556183+00 |
| description | A CLI designed to **automatically format SQL scripts**. |
| homepage | |
| repository | https://github.com/LugolBis/sqlformater |
| max_upload_size | |
| id | 1808289 |
| size | 98,396 |
sqlformater is a command-line tool (CLI) built in Rust, designed to automatically format SQL scripts. It supports individual files or entire directories and allows customized configuration via settings files.
Install with Cargo :
cargo install sqlformater
Install with Pip :
pip install sqlformater
Usage :
sqlformater <PATHS> [OPTIONS]
You can provide one or more of the following:
.sql files in the subdirectories..sql files: formats specific individual files.. or *: selects the current directory and all its subdirectories.| Option | Description |
|---|---|
-logs_path=<FOLDER_PATH>,--logs_path=<FOLDER_PATH> |
Specifies the folder where logs will be saved. |
-settings_path=<PATH>,--settings_path=<PATH> |
Path to the configuration file or the folder that contains it. |
-status,--status |
Shows diagnostic information: settings, logs, etc. |
-help,--help |
Displays general help. |
-help-settings,--help-settings |
Displays information about available configuration settings. |
Format all SQL files in the current directory and subdirectories:
sqlformater .
Format two specific files:
sqlformater tutu/queries/init.sql tutu/queries/update_users.sql
Format all files in a folder with a specific config file:
sqlformater home/tutu/migrations --settings_path=./config/settings.json
Enable verbose mode:
sqlformater * --verbose
You can customize the formatter's behavior via a configuration file. To see the available settings:
sqlformater --help-settings