soar-jetbrains-plugin
soar-jetbrains-plugin copied to clipboard
Plugin of https://github.com/XiaoMi/soar for JetBrains IDE which for SQL optimize and rewrite. SQL 优化工具 SOAR 的 JetBrains IDE 插件
SOAR JetBrains Plugin
中文
SOAR Plugin is a plugin of JetBrains IDE for Xiaomi's SOAR (SQL Optimizer And Rewrite), used for analysis SQL performance , give suggestion for optimize, and format SQL.
Demo
Analysis

Format

Install
Install form local file
- Download latest compressed package of SOAR plugin
- Open IDE,Settings -> Plugins -> Setting Button -> Install Plugin From Disk

- Choose location of the compressed package
- Restart IDE after install complete
Install from marketplace
- Settings -> Plugins -> Marketplace
- Search SOAR

- Click install, restart IDE after install complete
Configuration
Install SOAR
You need configure Go path correctly if you want use SOAR. You can reference from https://golang.org/doc/install for install and configure
- Open IDE, Settings -> Other Settings -> Soar (Older version is IDE Settings -> Soar)
- Click Init button to get install command

- There will input
${USER_HOME}/.soar/as default path after check success. Then copy the command of download and install SOAR
wget https://github.com/XiaoMi/soar/releases/download/0.10.0/soar.darwin-amd64 -O ${USER_HOME}/.soar/soar
- Execute modify permission execution command after download completed.
chmod a+x ${USER_HOME}/.soar/soar
-
Click Check button to check if SOAR installed correctly

-
Apply settings
Use file configuration
- Choose Use File Config
- Click Edit button after Config Path
- Input Database and other configuration as yours, you can reference Configuration instruction of SOAR configuration

- Click Edit button after Blacklist Path
- Add signature or Regex for not analysis SQL

Use manual configuration
- Choose Use Manual Config
- Input Database configuration

- Apply settings
Attention
- The account in test environment need all privilege, online account only need select permission
- The host
localhostis not support, please replace as127.0.0.1 - The special symbol in password is not support too, please use file configuration.
Usage
SQL Analysis
-
Select SQL content which need analysis, right click to open edit popup , then choose Soar -> SQL Analysis . Or you can use shortcut
ctrl + shift + Htoo
-
The analysis process will show in under border until analysis action complete.

-
There will show dialog when action completed.

Format SQL
-
Select SQL content which need format, right click to open edit popup , then choose Soar -> SQL Format . Or you can use shortcut
ctrl + shift + Jtoo
-
It will replace origin SQL content as formatted SQL after action complete. The format process will show in under border too.
