VictoriaMetrics/lib/metricsql/utils.go

13 lines
295 B
Go
Raw Normal View History

2019-12-25 21:19:34 +01:00
package metricsql
// ExpandWithExprs expands WITH expressions inside q and returns the resulting
// PromQL without WITH expressions.
func ExpandWithExprs(q string) (string, error) {
e, err := Parse(q)
if err != nil {
return "", err
}
buf := e.AppendString(nil)
return string(buf), nil
}