Resource download: https://download.csdn.net/download/wangjz2008/15364339
DBeaver configuration method
- Install jdk, 1.8 or above is required, 1.8.0_151 and above are recommended
- Unzip wjz-sqlFormat-1.0.zip to the DBeaver installation directory C:\ProgramFiles\DBeaver, which is level with the dbeaver.exe directory
结构:C:\ProgramFiles\DBeaver\wjz-sqlFormat-1.0\wjz-sqlFormat.jar
- Find the sql formatting menu in the DBeaver configuration project
Window->Preferences->DBeaver->Editors->sql editor->sql formatting
- Select the [format] drop-down box as [external formatter]
- Command line input: java -jar wjz-sqlFormat-1.0/wjz-sqlFormat.jar -filePath ${file}
- Check the use of temporary files, the timeout period is 2000 milliseconds
- 例子:java -jar wjz-sqlFormat.jar -filePath c:/sqlProject/test.sql
-help: help
-filePath: sql file directory
-fileEncoding: sql file encoding format gbk, utf-8, etc., the default system encoding
-sqlText: sql text
-tryLevel: Multi-database try level 0~2, default 0 (oracle, mysql, sqlServer), 1 (elasticSearch, postgreSql), 2 (db2, hive, h2, odps, phoneix)
-formatBy: 0~2, the default is 0. 0: (sqlInForm first, then druid), 1: sqlInForm, 2: druid