dont run queries if target has no table set

This commit is contained in:
Sven Klemm 2018-07-15 22:26:52 +02:00
parent 43686616a0
commit 7f348f3836

View File

@ -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();
}