sqlformater
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.
🚀 Getting Started
Install with Cargo :
Install with Pip :
Usage :
📂 : Specify the files or folders to format
You can provide one or more of the following:
- One or more folder paths: formats all
.sqlfiles in the subdirectories. - One or more
.sqlfiles: formats specific individual files. .or*: selects the current directory and all its subdirectories.
⚙️ Available Options
| 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. |
📘 Examples
Format all SQL files in the current directory and subdirectories:
Format two specific files:
Format all files in a folder with a specific config file:
Enable verbose mode:
🔧 Configuration
You can customize the formatter's behavior via a configuration file. To see the available settings: