mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-01 10:00:19 +08:00
feat: support to use a different db schema for pg (#2281)
This commit is contained in:
@ -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 ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user