mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 01:23:32 -06:00
dont run queries if target has no table set
This commit is contained in:
parent
43686616a0
commit
7f348f3836
@ -17,7 +17,7 @@ export default class PostgresQuery {
|
||||
target.metricColumn = target.metricColumn || 'none';
|
||||
|
||||
target.groupBy = target.groupBy || [];
|
||||
target.where = target.where || [];
|
||||
target.where = target.where || [{ type: 'macro', params: ['$__timeFilter'] }];
|
||||
target.select = target.select || [[{ type: 'column', params: ['value'] }]];
|
||||
|
||||
// handle pre query gui panels gracefully
|
||||
@ -77,6 +77,10 @@ export default class PostgresQuery {
|
||||
render(interpolate?) {
|
||||
let target = this.target;
|
||||
|
||||
if (!('table' in this.target)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (!target.rawQuery) {
|
||||
target.rawSql = this.buildQuery();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user