9e204bd88c
Like the KV function, this supports either separated strings or JSON strings, base64-encoded or not. Fixes #1619 in theory.
16 lines
242 B
Go
16 lines
242 B
Go
package mysql
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// Query templates a query for us.
|
|
func Query(tpl string, data map[string]string) string {
|
|
for k, v := range data {
|
|
tpl = strings.Replace(tpl, fmt.Sprintf("{{%s}}", k), v, -1)
|
|
}
|
|
|
|
return tpl
|
|
}
|