Support table schema edit

This commit is contained in:
SwallowGG
2023-10-09 18:27:24 +08:00
parent 51452dbfd0
commit ab1cad3cbe
16 changed files with 626 additions and 7 deletions

View File

@ -279,6 +279,7 @@ public class OracleMetaData extends DefaultMetaService implements MetaData {
.columnTypes(OracleColumnTypeEnum.getTypes())
.charsets(Lists.newArrayList())
.collations(Lists.newArrayList())
.indexTypes(OracleIndexTypeEnum.getIndexTypes())
.build();
}

View File

@ -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());
}
}