We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
测试代码:
@Test public void test() { String sqlWithLeadingComment = "/*0abcde*/select max(id) from base_request_log"; printFormatted(sqlWithLeadingComment); String sqlWithEndingComment = "select max(id) from base_request_log/*0abcde*/"; printFormatted(sqlWithEndingComment); String sqlWithIntermediateComment = "select max(id) from base_request_log /* haha */ ignore index (i1) "; printFormatted(sqlWithIntermediateComment); } private void printFormatted(String sql) { System.out.println("======"); // System.out.println(SQLUtils.formatMySql(sql)); System.out.println(SQLUtils.formatMySql(sql)); }
输出:
====== SELECT MAX(id) FROM base_request_log ====== SELECT MAX(id) FROM base_request_log ====== SELECT MAX(id) FROM base_request_log IGNORE INDEX (i1)
印象中旧版本的格式化实现,不会吞掉注释。
能否设置一个开关到FormatOption里面:是否保留注释 ?
The text was updated successfully, but these errors were encountered:
ODPS是支持保留注释的,并且做得比较完善。mysql部分支持了,只支持你所说的第一个场景。请使用新版本 https://github.com/alibaba/druid/releases/tag/1.0.30
Sorry, something went wrong.
经测试已经可用,高铁给力!
No branches or pull requests
测试代码:
输出:
印象中旧版本的格式化实现,不会吞掉注释。
能否设置一个开关到FormatOption里面:是否保留注释 ?
The text was updated successfully, but these errors were encountered: