!107 feat:支持修改表名、注释,oracle bug修复

* fix:修复oracle查询数据参数超过1000错误 ORA-01795
* feat:支持右键重命名表
* feat:支持修改表名、表注释
This commit is contained in:
zongyangleo
2024-03-04 11:32:04 +00:00
committed by Coder慌
parent 49d3f988c9
commit 008d34c453
10 changed files with 187 additions and 9 deletions

View File

@@ -86,6 +86,24 @@ func (od *OracleDialect) GetColumns(tableNames ...string) ([]dbi.Column, error)
return fmt.Sprintf("'%s'", dbType.RemoveQuote(val))
}), ",")
// 如果表数量超过了1000需要分批查询
if len(tableNames) > 1000 {
columns := make([]dbi.Column, 0)
for i := 0; i < len(tableNames); i += 1000 {
end := i + 1000
if end > len(tableNames) {
end = len(tableNames)
}
tables := tableNames[i:end]
cols, err := od.GetColumns(tables...)
if err != nil {
return nil, err
}
columns = append(columns, cols...)
}
return columns, nil
}
_, res, err := od.dc.Query(fmt.Sprintf(dbi.GetLocalSql(ORACLE_META_FILE, ORACLE_COLUMN_MA_KEY), tableName))
if err != nil {
return nil, err