Skip to content

Commit

Permalink
不支持的类型无法使用AI
Browse files Browse the repository at this point in the history
  • Loading branch information
Chat2DB-Pro committed Jun 13, 2024
1 parent 3784118 commit c560f7e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,16 @@ public enum SqlServerColumnTypeEnum implements ColumnBuilder {
XML("XML", false, false, true, false, false, false, true, true),


OTHER("OTHER", false, false, true, false, false, false, true, true),
;
private ColumnType columnType;

public static SqlServerColumnTypeEnum getByType(String dataType) {
return COLUMN_TYPE_MAP.get(dataType.toUpperCase());
SqlServerColumnTypeEnum typeEnum = COLUMN_TYPE_MAP.get(dataType.toUpperCase());
if (typeEnum == null) {
return OTHER;
}
return typeEnum;
}

private static Map<String, SqlServerColumnTypeEnum> COLUMN_TYPE_MAP = Maps.newHashMap();
Expand Down Expand Up @@ -255,7 +260,9 @@ private String buildDataType(TableColumn column, SqlServerColumnTypeEnum type) {
}
return script.toString();
}

if(OTHER.equals(columnType)){
return column.getColumnType();
}

return columnType;
}
Expand Down

0 comments on commit c560f7e

Please sign in to comment.