Don't pass datasource to newPostgresMacroEngine

This commit is contained in:
Sven Klemm
2018-08-14 09:15:24 +02:00
parent 3552a4cb86
commit 3955133f7e
3 changed files with 7 additions and 13 deletions

View File

@ -7,7 +7,6 @@ import (
"strings"
"time"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/tsdb"
)
@ -21,10 +20,8 @@ type postgresMacroEngine struct {
timescaledb bool
}
func newPostgresMacroEngine(datasource *models.DataSource) tsdb.SqlMacroEngine {
engine := &postgresMacroEngine{}
engine.timescaledb = datasource.JsonData.Get("timescaledb").MustBool(false)
return engine
func newPostgresMacroEngine(timescaledb bool) tsdb.SqlMacroEngine {
return &postgresMacroEngine{timescaledb: timescaledb}
}
func (m *postgresMacroEngine) Interpolate(query *tsdb.Query, timeRange *tsdb.TimeRange, sql string) (string, error) {