uroboroSQL-fmt for VSCode
A Visual Studio Code extension for uroboroSQL-fmt that is a tool that formats SQL statements according to SQL coding standards created by Future Corporation (Japanese only).
Usage
Once installed in Visual Studio Code, "uroborosql-fmt" will be available as a formatter for SQL files. Please select "uroborosql-fmt" (extension id:Future.uroborosql-fmt
) as the default formatter. You can do this either by using the context menu (right click on a open SQL file in the editor) and select "Format Document With...", or you can add the following to your settings:
{
"[sql]": {
"editor.defaultFormatter": "Future.uroborosql-fmt"
}
}
You can enable format on save for SQL by having the following values in your settings:
{
"[sql]": {
"editor.defaultFormatter": "Future.uroborosql-fmt",
"editor.formatOnSave": true
}
}
Settings
Settings |
Defaults |
Description |
uroborosql-fmt.configurationFilePath |
null |
The path of configuration file. File extension must be .json . If you don't specify the path and ./.uroborosqlfmtrc.json exists, formatter will use ./.uroborosqlfmtrc.json . If you doesn't specify and .uroborosqlfmtrc.json doesn't exist, formatter will use formatters default configurations. |
Configuration options
{
"debug": false,
"tab_size": 4,
"complement_alias": true,
"trim_bind_param": false,
"keyword_case": "preserve",
"identifier_case": "preserve",
"max_char_per_line": 50,
"complement_outer_keyword": true,
"complement_column_as_keyword": true,
"remove_table_as_keyword": true,
"remove_redundant_nest": true,
"complement_sql_id": true,
"convert_double_colon_cast": false,
"unify_not_equal": true
}
Create .uroborosqlfmtrc.json
in the directory where you run the command and write the configuration there.
If there is no configuration file, the default values are used.
Available Commands
command title |
description |
Format SQL |
You can trigger formatting by executing this command. |
Export workspace config to uroborosql-fmt config file |
You can export workspace configurations to formatter's configuration file (specified in uroborosql-fmt.configurationFilePath). Only the non-null configurations in settings.json will overwrite those in .uroborosqlfmtrc.json . |
Import uroborosql-fmt config file config to workspace config |
You can import formatter's configuration into workspace configuration. Configuration values that exist in settings.json , but not in .uroborosqlfmtrc.json , will be set to null . |
Import uroborosql-fmt config file config to global config |
You can import formatter's configuration into global configuration. Configuration values that exist in settings.json , but not in .uroborosqlfmtrc.json , will be set to null . |
License
Business Source License 1.1