mirror of
https://github.com/grafana/grafana.git
synced 2025-07-30 13:22:17 +08:00
QueryInspector: add common way to show the raw query (#25204)
This commit is contained in:
@ -25,6 +25,9 @@ import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
// MetaKeyExecutedQueryString is the key where the executed query should get stored
|
||||
const MetaKeyExecutedQueryString = "executedQueryString"
|
||||
|
||||
// SqlMacroEngine interpolates macros into sql. It takes in the Query to have access to query context and
|
||||
// timeRange to be able to generate queries that use from and to.
|
||||
type SqlMacroEngine interface {
|
||||
@ -153,7 +156,7 @@ func (e *sqlQueryEndpoint) Query(ctx context.Context, dsInfo *models.DataSource,
|
||||
continue
|
||||
}
|
||||
|
||||
queryResult.Meta.Set("sql", rawSQL)
|
||||
queryResult.Meta.Set(MetaKeyExecutedQueryString, rawSQL)
|
||||
|
||||
wg.Add(1)
|
||||
|
||||
|
Reference in New Issue
Block a user