sql-formatter
A Sublime Text plugin that runs the cli-sql-formatter node library on the current file
Details
Installs
- Total 34K
- Win 17K
- Mac 13K
- Linux 4K
Sep 23 | Sep 22 | Sep 21 | Sep 20 | Sep 19 | Sep 18 | Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | 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 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 1 | 12 | 14 | 16 | 13 | 14 | 4 | 2 | 7 | 14 | 14 | 12 | 8 | 0 | 4 | 7 | 7 | 16 | 11 | 5 | 0 | 1 | 6 | 11 | 8 | 17 | 15 | 2 | 0 | 7 | 9 | 15 | 10 | 9 | 4 | 3 | 9 | 16 | 7 | 18 | 5 | 3 | 1 | 10 | 16 | 10 |
Mac | 0 | 8 | 14 | 16 | 16 | 11 | 0 | 3 | 13 | 10 | 9 | 11 | 8 | 2 | 5 | 4 | 15 | 6 | 11 | 12 | 3 | 1 | 11 | 8 | 10 | 14 | 8 | 2 | 3 | 12 | 11 | 10 | 9 | 6 | 0 | 3 | 17 | 8 | 8 | 10 | 5 | 2 | 1 | 9 | 10 | 14 |
Linux | 0 | 0 | 3 | 2 | 1 | 2 | 0 | 0 | 1 | 2 | 1 | 3 | 4 | 0 | 0 | 3 | 0 | 1 | 2 | 1 | 0 | 0 | 1 | 2 | 3 | 4 | 6 | 0 | 0 | 4 | 0 | 0 | 5 | 1 | 0 | 0 | 2 | 2 | 1 | 2 | 3 | 1 | 0 | 5 | 1 | 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
}
}