sql-formatter
A Sublime Text plugin that runs the cli-sql-formatter node library on the current file
Details
Installs
- Total 42K
- Win 21K
- Mac 17K
- Linux 5K
Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | Aug 1 | Jul 31 | Jul 30 | Jul 29 | Jul 28 | Jul 27 | Jul 26 | Jul 25 | Jul 24 | Jul 23 | Jul 22 | Jul 21 | Jul 20 | Jul 19 | Jul 18 | Jul 17 | Jul 16 | Jul 15 | Jul 14 | Jul 13 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 6 | 6 | 0 | 0 | 8 | 5 | 11 | 8 | 7 | 1 | 2 | 6 | 9 | 8 | 9 | 7 | 1 | 2 | 6 | 12 | 5 | 9 | 5 | 2 | 1 | 6 | 8 | 8 | 9 | 8 | 1 | 0 | 3 | 11 | 12 | 9 | 4 | 3 | 3 | 10 | 9 | 6 | 7 | 7 | 1 |
Mac | 0 | 6 | 7 | 0 | 1 | 11 | 11 | 6 | 13 | 7 | 1 | 0 | 5 | 8 | 18 | 5 | 7 | 4 | 0 | 8 | 4 | 8 | 9 | 6 | 1 | 1 | 9 | 12 | 10 | 12 | 7 | 2 | 4 | 8 | 10 | 11 | 5 | 3 | 1 | 1 | 8 | 4 | 5 | 3 | 7 | 1 |
Linux | 0 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 3 | 1 | 0 | 0 | 0 | 3 | 2 | 2 | 1 | 1 | 0 | 0 | 0 | 2 | 2 | 4 | 0 | 1 | 2 | 2 | 2 | 5 | 0 | 1 | 2 | 0 | 2 | 3 | 1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
sublime-sql-formatter
A Sublime Text plugin that runs the cli-sql-formatter node library on the current file. cli-sql-formatter is in turn a command line interface for the sql-formatter node library.
Installation
Dependencies
This plugin requires node.js, and also requires cli-sql-formatter to be globally installed.
npm install -g cli-sql-formatter
Plugin Installation
This plugin is installable via Package Control
To install via Package Control, do the following:
Within Sublime Text, bring up the Command Palette and type
install
. Among the commands you should seePackage Control: Install Package
. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.When the plugin list appears, type
sql-formatter
. Among the entries you should seesql-formatter
. Select this entry to install it.
Commands
Command Palette
Format SQL
: Runs the formatter with the default dialect defined in your settings.Format SQL With Dialect
: Runs the formatter with a dialect of your choosing.
Default Hotkeys
By default, these hotkeys will run the formatter with the default dialect defined in your settings.
- Linux/Windows: [Ctrl + KQ]
- Mac: [Cmd + KQ]
Settings
By default the following settings are used:
{
// The paths to look for executables
"paths": {
"linux": [],
"osx": [],
"windows": []
},
// The default dialect to use for formatting
// Options:
// "sql" - Standard SQL
// "n1ql" - Couchbase N1QL
// "db2" - IBM DB2
// "pl/sql" - Oracle PL/SQL
"default_dialect": "sql",
// The number of spaces to indent with
"indent_size": 2,
// Indent with tabs instead of spaces
"use_tabs": false
}
You can modify any settings by going to Preferences > Package Settings > sql-formatter > Settings.
Project-Specific Settings Override
To override global plugin configuration for a specific project, add a settings object with an sql-formatter
key in your .sublime-project
. This file is accessible via Project -> Edit Project
.
For example:
{
"folders": [
{
"path": "."
}
],
"settings": {
"use_tabs": true
}
}