!88 feat: dbms表支持右键菜单:删除表、编辑表、新建表、复制表

* feat: 支持复制表
* feat: dbms表支持右键菜单:删除表、编辑表、新建表
This commit is contained in:
zongyangleo
2024-01-23 04:08:02 +00:00
committed by Coder慌
parent 3b77ab2727
commit 3fc86f0fae
16 changed files with 330 additions and 33 deletions

View File

@@ -340,3 +340,14 @@ func (od *OracleDialect) FormatStrData(dbColumnValue string, dataType dbi.DataTy
}
return dbColumnValue
}
func (od *OracleDialect) CopyTable(copy *dbi.DbCopyTable) error {
// 生成新表名,为老表明+_copy_时间戳
newTableName := strings.ToUpper(copy.TableName + "_copy_" + time.Now().Format("20060102150405"))
condition := ""
if copy.CopyData {
condition = " where 1 = 2"
}
_, err := od.dc.Exec(fmt.Sprintf("create table \"%s\" as select * from \"%s\" %s", newTableName, copy.TableName, condition))
return err
}