Skip to content

Commit

Permalink
✨ 优化getDdlGenerator的方法去除不必要的case分支
Browse files Browse the repository at this point in the history
  • Loading branch information
cktk committed Apr 1, 2024
1 parent 59d69a5 commit 8ac7994
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ public static ScriptRunner getScriptRunner(Connection connection, boolean autoCo
protected static IDdlGenerator getDdlGenerator(String jdbcUrl) throws RuntimeException {
DbType dbType = JdbcUtils.getDbType(jdbcUrl);
switch (dbType) {
case OTHER:
throw ExceptionUtils.mpe("%s database not supported.", dbType.getDb());
case MYSQL:
case MYSQL:
case MARIADB:
case GBASE:
case OSCAR:
Expand Down Expand Up @@ -186,20 +184,7 @@ protected static IDdlGenerator getDdlGenerator(String jdbcUrl) throws RuntimeExc
case GBASE8S_PG:
case GBASE_8C:
return PostgreDdlGenerator.newInstance();
case DB2:
case SQL_SERVER2005:
case SYBASE:
case XCloud:
case GBASE_8S:
case GBASEDBT:
case GBASE_INFORMIX:
case SINODB:
case INFORMIX:
case TRINO:
case PRESTO:
throw ExceptionUtils.mpe("%s database not supported.", dbType.getDb());
// 处理未知的数据库类型
default:
default:
throw ExceptionUtils.mpe("%s database not supported.", dbType.getDb());
}

Expand Down

0 comments on commit 8ac7994

Please sign in to comment.