Formatting helps keep SQL readable and consistent across transformations.
In the Edit Action dialog, use the Format action (right click 'Format' or shortcut 'Alt + Shift + F') to format the current SQL statement.
datasqill supports two formatter modes:
Embedded formatter (default)
Uses the integrated SQLinForm library. Formatting options are read from view tv_sqts_config_global with keys:
GUI / CONFIG / FORMATTER / SQL
External formatter (optional)
Runs an external command from the search path (PATH). The provider is configured in view tv_sqts_config_global with key:
GUI / CONFIG / FORMATTER / PROVIDER
Example external provider configuration (stdin → stdout):
{
"provider": "external",
"command": "myformatter.exe",
"input": "stdin",
"output": "stdout",
"args": [],
"timeoutMs": 10000,
"fallbackToEmbedded": true
}
The external formatter must be on the search path (PATH) so that the datasqill GUI can find and invoke it.
For external formatters, input and output can be configured:
input: stdin or fileoutput: stdout or fileThe args list may contain placeholders for temporary files:
{inputFile} for the input file{outputFile} for the output fileSupported variants:
| input | output | args (example) |
|---|---|---|
stdin |
stdout |
[] |
file |
stdout |
["--input", "{inputFile}"] |
stdin |
file |
["--output", "{outputFile}"] |
file |
file |
["--input", "{inputFile}", "--output", "{outputFile}"] |
If input=file, {inputFile} must appear in args. If output=file, {outputFile} must appear in args. The actual arguments (--input, --output, etc.) must match the external tool's CLI.
Example for file → stdout (e.g. when the tool expects an input file):
{
"provider": "external",
"command": "myformatter.exe",
"input": "file",
"output": "stdout",
"args": ["--input", "{inputFile}"],
"timeoutMs": 10000,
"fallbackToEmbedded": true
}
Behavior in case of external formatter issues:
fallbackToEmbedded is true, datasqill falls back to the embedded formatter.fallbackToEmbedded is false, formatting fails and an error message is shown (including exit code and stderr excerpt when available).Formatting runs in the background so the GUI stays responsive. If the SQL code is changed while formatting is in progress, the formatting result is discarded and not applied.