feat: support to use a different db schema for pg (#2281)

This commit is contained in:
Tower He
2023-09-01 18:00:17 +08:00
committed by Yang Luo
parent 0c7b911ce7
commit bbf2db2e00
5 changed files with 50 additions and 14 deletions

View File

@ -23,6 +23,7 @@ import (
"math/rand"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
@ -315,3 +316,13 @@ func ParseIdToString(input interface{}) (string, error) {
return "", fmt.Errorf("unsupported id type: %T", input)
}
}
func GetValueFromDataSourceName(key string, dataSourceName string) string {
reg := regexp.MustCompile(key + "=([^ ]+)")
matches := reg.FindStringSubmatch(dataSourceName)
if len(matches) >= 2 {
return matches[1]
}
return ""
}