mirror of
https://github.com/grafana/grafana.git
synced 2025-09-25 21:44:02 +08:00
dont expand variables in rawSql
This commit is contained in:
@ -77,22 +77,16 @@ export default class PostgresQuery {
|
|||||||
|
|
||||||
render(interpolate?) {
|
render(interpolate?) {
|
||||||
let target = this.target;
|
let target = this.target;
|
||||||
let query;
|
|
||||||
|
|
||||||
if (target.rawQuery) {
|
if (!target.rawQuery) {
|
||||||
if (interpolate) {
|
target.rawSql = this.buildQuery();
|
||||||
return this.templateSrv.replace(target.rawSql, this.scopedVars, this.interpolateQueryStr);
|
|
||||||
} else {
|
|
||||||
return target.rawSql;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
query = this.buildQuery();
|
|
||||||
if (interpolate) {
|
if (interpolate) {
|
||||||
query = this.templateSrv.replace(query, this.scopedVars, this.interpolateQueryStr);
|
return this.templateSrv.replace(target.rawSql, this.scopedVars, this.interpolateQueryStr);
|
||||||
|
} else {
|
||||||
|
return target.rawSql;
|
||||||
}
|
}
|
||||||
this.target.rawSql = query;
|
|
||||||
return query;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTimeColumn() {
|
buildTimeColumn() {
|
||||||
|
Reference in New Issue
Block a user