[improvement][project] Keep the style consistent when displaying various SQL queries on the Chat page. (#684)

This commit is contained in:
lexluo09
2024-01-23 15:10:48 +08:00
committed by GitHub
parent 42a6f61456
commit 9d6f96e6d4
14 changed files with 141 additions and 139 deletions

View File

@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
@Data
public class SqlExecuteReq {
public static final String LIMIT_WRAPPER = " select * from ( %s ) a limit 1000 ";
public static final String LIMIT_WRAPPER = " SELECT * FROM ( %s ) a LIMIT 1000 ";
@NotNull(message = "modelId can not be null")
private Long id;

View File

@@ -91,7 +91,7 @@ public abstract class SemanticNode {
public static String getSql(SqlNode sqlNode, EngineType engineType) {
SemanticSqlDialect sqlDialect = SqlDialectFactory.getSqlDialect(engineType);
SqlWriterConfig config = SqlPrettyWriter.config().withDialect(sqlDialect)
.withKeywordsLowerCase(true).withClauseEndsLine(true).withAlwaysUseParentheses(false)
.withKeywordsLowerCase(false).withClauseEndsLine(true).withAlwaysUseParentheses(false)
.withSelectListItemsOnSeparateLines(false).withUpdateSetListNewline(false).withIndentation(0);
UnaryOperator<SqlWriterConfig> sqlWriterConfigUnaryOperator = (c) -> config;