mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-07-29 18:53:12 +08:00
Support table schema edit
This commit is contained in:
@ -279,6 +279,7 @@ public class OracleMetaData extends DefaultMetaService implements MetaData {
|
||||
.columnTypes(OracleColumnTypeEnum.getTypes())
|
||||
.charsets(Lists.newArrayList())
|
||||
.collations(Lists.newArrayList())
|
||||
.indexTypes(OracleIndexTypeEnum.getIndexTypes())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,14 @@
|
||||
package ai.chat2db.plugin.oracle.type;
|
||||
|
||||
import ai.chat2db.spi.enums.EditStatus;
|
||||
import ai.chat2db.spi.model.IndexType;
|
||||
import ai.chat2db.spi.model.TableIndex;
|
||||
import ai.chat2db.spi.model.TableIndexColumn;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public enum OracleIndexTypeEnum {
|
||||
|
||||
PRIMARY_KEY("Primary", "PRIMARY KEY"),
|
||||
@ -15,6 +19,16 @@ public enum OracleIndexTypeEnum {
|
||||
|
||||
BITMAP("BITMAP", "BITMAP INDEX");
|
||||
|
||||
public IndexType getIndexType() {
|
||||
return indexType;
|
||||
}
|
||||
|
||||
public void setIndexType(IndexType indexType) {
|
||||
this.indexType = indexType;
|
||||
}
|
||||
|
||||
private IndexType indexType;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@ -32,6 +46,7 @@ public enum OracleIndexTypeEnum {
|
||||
OracleIndexTypeEnum(String name, String keyword) {
|
||||
this.name = name;
|
||||
this.keyword = keyword;
|
||||
this.indexType = new IndexType(name);
|
||||
}
|
||||
|
||||
|
||||
@ -104,4 +119,8 @@ public enum OracleIndexTypeEnum {
|
||||
|
||||
return script.toString();
|
||||
}
|
||||
|
||||
public static List<IndexType> getIndexTypes() {
|
||||
return Arrays.asList(OracleIndexTypeEnum.values()).stream().map(OracleIndexTypeEnum::getIndexType).collect(java.util.stream.Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user