mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
12 lines
295 B
Go
12 lines
295 B
Go
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
|
|
}
|