This commit is contained in:
SwallowGG
2023-09-24 10:06:29 +08:00
parent ea0730dad0
commit 094f28bea9
2 changed files with 3 additions and 3 deletions

View File

@ -86,7 +86,7 @@ public class TableServiceImpl implements TableService {
@Override @Override
public ListResult<Sql> buildSql(Table oldTable, Table newTable) { public ListResult<Sql> buildSql(Table oldTable, Table newTable) {
SqlBuilder sqlBuilder = Chat2DBContext.getSqlBuilder(oldTable.getDbType()); SqlBuilder sqlBuilder = Chat2DBContext.getSqlBuilder();
List<Sql> sqls = new ArrayList<>(); List<Sql> sqls = new ArrayList<>();
if (oldTable == null) { if (oldTable == null) {
sqls.add(Sql.builder().sql(sqlBuilder.buildCreateTableSql(newTable)).build()); sqls.add(Sql.builder().sql(sqlBuilder.buildCreateTableSql(newTable)).build());

View File

@ -43,8 +43,8 @@ public class Chat2DBContext {
return PLUGIN_MAP.get(dbType).getDBConfig().getDefaultDriverConfig(); return PLUGIN_MAP.get(dbType).getDBConfig().getDefaultDriverConfig();
} }
public static SqlBuilder getSqlBuilder(String dbType) { public static SqlBuilder getSqlBuilder() {
return PLUGIN_MAP.get(dbType).getMetaData().getSqlBuilder(); return PLUGIN_MAP.get(getConnectInfo().getDbType()).getMetaData().getSqlBuilder();
} }
/** /**