!108 feat:支持不同源数据库迁移

* feat:支持不同源数据库迁移
This commit is contained in:
zongyangleo
2024-03-15 09:01:51 +00:00
committed by Coder慌
parent 263dfa6be7
commit bd1e83989d
44 changed files with 3064 additions and 104 deletions

View File

@@ -1,5 +1,7 @@
package collx
import "strings"
// 数组比较
// 依次返回,新增值,删除值,以及不变值
func ArrayCompare[T comparable](newArr []T, oldArr []T) ([]T, []T, []T) {
@@ -143,3 +145,13 @@ func ArrayDeduplicate[T comparable](arr []T) []T {
return result
}
// ArrayAnyMatches 给定字符串是否包含指定数组中的任意字符串, 如:["time", "date"] , substr : timestamp返回true
func ArrayAnyMatches(arr []string, subStr string) bool {
for _, itm := range arr {
if strings.Contains(subStr, itm) {
return true
}
}
return false
}