dBeaver sql formatting configuration

Resource download: https://download.csdn.net/download/wangjz2008/15364339

DBeaver configuration method

  1. Install jdk, 1.8 or above is required, 1.8.0_151 and above are recommended
  2. 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

 

  1. Find the sql formatting menu in the DBeaver configuration project

Window->Preferences->DBeaver->Editors->sql editor->sql formatting

  1. Select the [format] drop-down box as [external formatter]
  2. Command line input: java -jar wjz-sqlFormat-1.0/wjz-sqlFormat.jar -filePath ${file}
  3. Check the use of temporary files, the timeout period is 2000 milliseconds 

 

  1. 例子: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

 

Guess you like

Origin blog.csdn.net/wangjz2008/article/details/114082969