Search in sources :

Example 1 with SQLTokenizedFormatter

use of org.jkiss.dbeaver.model.sql.format.tokenized.SQLTokenizedFormatter in project dbeaver by serge-rider.

the class SQLUtils method formatSQL.

public static String formatSQL(SQLDataSource dataSource, String query) {
    SQLSyntaxManager syntaxManager = new SQLSyntaxManager();
    syntaxManager.init(dataSource.getSQLDialect(), dataSource.getContainer().getPreferenceStore());
    SQLFormatterConfiguration configuration = new SQLFormatterConfiguration(syntaxManager);
    return new SQLTokenizedFormatter().format(query, configuration);
}
Also used : SQLTokenizedFormatter(org.jkiss.dbeaver.model.sql.format.tokenized.SQLTokenizedFormatter) SQLFormatterConfiguration(org.jkiss.dbeaver.model.sql.format.SQLFormatterConfiguration)

Aggregations

SQLFormatterConfiguration (org.jkiss.dbeaver.model.sql.format.SQLFormatterConfiguration)1 SQLTokenizedFormatter (org.jkiss.dbeaver.model.sql.format.tokenized.SQLTokenizedFormatter)1