fix(unified-storage): use the provided connection config parameters (#107455)
* fix(unified-storage): use the provided connection config parameters * extend tests * make update-workspace
This commit is contained in:
committed by
GitHub
parent
03fff523b1
commit
d76e55371a
@@ -18,6 +18,7 @@ type confGetter interface {
|
||||
Err() error
|
||||
Bool(key string) bool
|
||||
String(key string) string
|
||||
Int(key string, def int) int
|
||||
}
|
||||
|
||||
func newConfGetter(ds *setting.DynamicSection, keyPrefix string) confGetter {
|
||||
@@ -52,6 +53,10 @@ func (g *sectionGetter) String(key string) string {
|
||||
return v
|
||||
}
|
||||
|
||||
func (g *sectionGetter) Int(key string, def int) int {
|
||||
return g.ds.Key(g.keyPrefix + key).MustInt(def)
|
||||
}
|
||||
|
||||
// MakeDSN creates a DSN from the given key/value pair. It validates the strings
|
||||
// form valid UTF-8 sequences and escapes values if needed.
|
||||
func MakeDSN(m map[string]string) (string, error) {
|
||||
|
||||
Reference in New Issue
Block a user