helloworlde / soar-jetbrains-plugin

Plugin of https://github.com/XiaoMi/soar for JetBrains IDE which for SQL optimize and rewrite. SQL 优化工具 SOAR 的 JetBrains IDE 插件

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SOAR JetBrains Plugin

JetBrains Plugins Downloads Downloads last month

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

Analysis Demo-Gif

Format

Format Demo-Gif

Install

Install form local file

  1. Download latest compressed package of SOAR plugin
  2. Open IDE,Settings -> Plugins -> Setting Button -> Install Plugin From Disk Install SOAR
  3. Choose location of the compressed package
  4. Restart IDE after install complete

Install from marketplace

  1. Settings -> Plugins -> Marketplace
  2. Search SOAR Install from marketplace
  3. 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

  1. Open IDE, Settings -> Other Settings -> Soar (Older version is IDE Settings -> Soar)
  2. Click Init button to get install command SOAR Init
  3. There will input ${USER_HOME}/.soar/ as default path after check success. Then copy the command of download and install SOAR SOAR Init
wget https://github.com/XiaoMi/soar/releases/download/0.10.0/soar.darwin-amd64 -O ${USER_HOME}/.soar/soar
  1. Execute modify permission execution command after download completed.
chmod a+x ${USER_HOME}/.soar/soar
  1. Click Check button to check if SOAR installed correctly Soar Check

  2. Apply settings

Use file configuration

  1. Choose Use File Config
  2. Click Edit button after Config Path
  3. Input Database and other configuration as yours, you can reference Configuration instruction of SOAR configuration Configuration
  4. Click Edit button after Blacklist Path
  5. Add signature or Regex for not analysis SQL Blacklist

Use manual configuration

  1. Choose Use Manual Config
  2. Input Database configuration Manual Config
  3. Apply settings

Attention

  • The account in test environment need all privilege, online account only need select permission
  • The host localhost is not support, please replace as 127.0.0.1
  • The special symbol in password is not support too, please use file configuration.

Usage

SQL Analysis

  1. Select SQL content which need analysis, right click to open edit popup , then choose Soar -> SQL Analysis . Or you can use shortcut ctrl + shift + H too Analysis Action

  2. The analysis process will show in under border until analysis action complete. Analysis Process

  3. There will show dialog when action completed. Analysis Result

Format SQL

  1. Select SQL content which need format, right click to open edit popup , then choose Soar -> SQL Format . Or you can use shortcut ctrl + shift + J too Format Action

  2. It will replace origin SQL content as formatted SQL after action complete. The format process will show in under border too. Format Process Format Result

About

Plugin of https://github.com/XiaoMi/soar for JetBrains IDE which for SQL optimize and rewrite. SQL 优化工具 SOAR 的 JetBrains IDE 插件

License:Apache License 2.0


Languages

Language:Java 100.0%