vertical-blank / sql-formatter

SQL formatter written with only Java Standard Library, without dependencies.
MIT License
223 stars 46 forks source link

Comments and the "BETWEEN ... AND " clause are not formatted correctly. #24

Closed ymz112 closed 3 years ago

ymz112 commented 3 years ago

If we put comments and all the sql in one line, it would not identify the sql and still in one line.

The between ... and ... clause should in the same line, right now the behavior is that before every and it would have a newline.

And just for suggestion, maybe your guys could consider some caching or other ways to improve the performance, it's almost 100X slower than hibernate core sql formatter when it comes to long queries.

vertical-blank commented 3 years ago

On 2.0.0, sql and comments in single line are formatted collectly.

https://github.com/vertical-blank/sql-formatter/blob/master/src/test/kotlin/com/github/vertical_blank/sqlformatter/StandardSqlFormatterTest.kt#L54-L70