mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-29 02:32:33 +08:00
增加DB2、DM、KingBase、PostgreSQL、Sqlite、SqlServer默认值下拉配置。
This commit is contained in:
@ -8,6 +8,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import ai.chat2db.plugin.sqlserver.builder.SqlServerSqlBuilder;
|
||||
import ai.chat2db.plugin.sqlserver.type.SqlServerColumnTypeEnum;
|
||||
import ai.chat2db.plugin.sqlserver.type.SqlServerDefaultValueEnum;
|
||||
import ai.chat2db.plugin.sqlserver.type.SqlServerIndexTypeEnum;
|
||||
import ai.chat2db.spi.MetaData;
|
||||
import ai.chat2db.spi.SqlBuilder;
|
||||
@ -382,6 +383,7 @@ public class SqlServerMetaData extends DefaultMetaService implements MetaData {
|
||||
.charsets(null)
|
||||
.collations(null)
|
||||
.indexTypes(SqlServerIndexTypeEnum.getIndexTypes())
|
||||
.defaultValues(SqlServerDefaultValueEnum.getDefaultValues())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,27 @@
|
||||
package ai.chat2db.plugin.sqlserver.type;
|
||||
|
||||
import ai.chat2db.spi.model.DefaultValue;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum SqlServerDefaultValueEnum {
|
||||
EMPTY_STRING("EMPTY_STRING"),
|
||||
NULL("NULL"),
|
||||
;
|
||||
private DefaultValue defaultValue;
|
||||
|
||||
SqlServerDefaultValueEnum(String defaultValue) {
|
||||
this.defaultValue = new DefaultValue(defaultValue);
|
||||
}
|
||||
|
||||
|
||||
public DefaultValue getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public static List<DefaultValue> getDefaultValues() {
|
||||
return Arrays.stream(SqlServerDefaultValueEnum.values()).map(SqlServerDefaultValueEnum::getDefaultValue).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user