mirror of
https://github.com/grafana/grafana.git
synced 2025-07-29 22:22:25 +08:00
Expressions: expose ConvertDataFramesToResults (#83805)
This commit is contained in:
@ -19,12 +19,11 @@ import (
|
||||
type SQLCommand struct {
|
||||
query string
|
||||
varsToQuery []string
|
||||
timeRange TimeRange
|
||||
refID string
|
||||
}
|
||||
|
||||
// NewSQLCommand creates a new SQLCommand.
|
||||
func NewSQLCommand(refID, rawSQL string, tr TimeRange) (*SQLCommand, error) {
|
||||
func NewSQLCommand(refID, rawSQL string) (*SQLCommand, error) {
|
||||
if rawSQL == "" {
|
||||
return nil, errutil.BadRequest("sql-missing-query",
|
||||
errutil.WithPublicMessage("missing SQL query"))
|
||||
@ -39,7 +38,6 @@ func NewSQLCommand(refID, rawSQL string, tr TimeRange) (*SQLCommand, error) {
|
||||
return &SQLCommand{
|
||||
query: rawSQL,
|
||||
varsToQuery: tables,
|
||||
timeRange: tr,
|
||||
refID: refID,
|
||||
}, nil
|
||||
}
|
||||
@ -59,7 +57,7 @@ func UnmarshalSQLCommand(rn *rawNode) (*SQLCommand, error) {
|
||||
return nil, fmt.Errorf("expected sql expression to be type string, but got type %T", expressionRaw)
|
||||
}
|
||||
|
||||
return NewSQLCommand(rn.RefID, expression, rn.TimeRange)
|
||||
return NewSQLCommand(rn.RefID, expression)
|
||||
}
|
||||
|
||||
// NeedsVars returns the variable names (refIds) that are dependencies
|
||||
|
Reference in New Issue
Block a user