sql-formatter
sql-formatter copied to clipboard
Issue when column name contains escaped enclosing character
The query
SqlFormatter.of(Dialect.PlSql)
.extend(cfg -> cfg.plusOperators("->"))
.format("SELECT `My field with \\` back () <<<<<< tick and a verryyyyyyyy long name` FROM MY_TABLE");
produces
SELECT
`My field with \` back < < < < < < tick
and a verryyyyyyyy long name ` FROM MY_TABLE
Which is no longer a valid query as the name has been split over multiple lines and whitespaces have been included.
I think that the first `
is detected as the end of the name even though it is escaped with a \
.
Is there any way to specify such an escape pattern in column names ?