refactor: dbms与标签管理优化

This commit is contained in:
meilin.huang
2024-03-21 17:15:52 +08:00
parent b13d27ccd6
commit b2cfd1517c
43 changed files with 536 additions and 564 deletions

View File

@@ -8,6 +8,8 @@ import (
"mayfly-go/pkg/utils/collx"
"strings"
"time"
"github.com/may-fly/cast"
)
type PgsqlDialect struct {
@@ -141,7 +143,7 @@ func (pd *PgsqlDialect) CopyTable(copy *dbi.DbCopyTable) error {
}
for _, re := range res {
colName := anyx.ConvString(re["column_name"])
colName := cast.ToString(re["column_name"])
if colName != "" {
// 查询自增列当前最大值
@@ -149,7 +151,7 @@ func (pd *PgsqlDialect) CopyTable(copy *dbi.DbCopyTable) error {
if err != nil {
return err
}
maxVal := anyx.ConvInt(maxRes[0]["max_val"])
maxVal := cast.ToInt(maxRes[0]["max_val"])
// 序列起始值为1或当前最大值+1
if maxVal <= 0 {
maxVal = 1