[关闭]
@lumincinta 2017-02-07T12:39:07.000000Z 字数 989 阅读 317

Sublime Plugin : SQL格式化插件

SublimePlugin


安装SublimeFormatSQL

  • Add Repository
  • 安装SublimeFormatSQL
    • Crtl + Shift + p 调出 package control,输入 install package,确定,然后再输入 github 仓库的名称,比如 SublimeFormatSQL,确定安装。

Reference: Add Repository


SublimeFormatSQL

SublimeFormatSQL

This is a fork from SublimeFormatSQL that fixes a known issue with Sublime Text 2. There will be no support for Sublime Text 3.

Because this isn't an official package, you can follow this instructions to install.

From the original README:

Summary

FormatSQL formats long SQL statement to a more readable form by using python-sqlparse library.

How to Use

select sql and click menu Selection -> Format -> SQL

Configure key binding

add the following line to keymap settings

  1. { "keys": ["super+k", "super+s"], "command": "format_sql" },

Example

Original:

  1. select a,b from foo join bar on val1 = val2 where id = 123 and cd = 99;

Formated:

  1. SELECT a,
  2. b
  3. FROM foo
  4. JOIN bar ON val1 = val2
  5. WHERE id = 123
  6. AND cd = 99;

License

python-sqlparse library and this code are both on 2-clauses BSD

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注