Extra space inserted inside backtick strings
Closed this issue · 2 comments
whiterook6 commented
If I format an SQL string like this:
SELECT * FROM `tableName`;
The resulting formatted string is like this:
SELECT * FROM ` tableName `;
The extra spaces break my query. Is there a way to fix this, or an option to disable this particular extra space?
vertical-blank commented
@whiterook6
Treating backquotes as identifier literals is MySQLs dialect, so try this.
SqlFormatter
.of(Dialect.MySql)
.format("SELECT * FROM `tableName`;")
whiterook6 commented
That seems to work! Thank you.