mysql-connector: compact SQL queries

This commit is contained in:
Alexander Zobnin
2017-07-22 21:00:40 +03:00
parent 3795ce564e
commit 59bfacccbc
4 changed files with 16 additions and 1 deletions

View File

@@ -62,6 +62,7 @@ System.register(['angular', 'lodash'], function (_export, _context) {
var query = '\n SELECT itemid AS metric, clock AS time_sec, ' + aggFunction + '(value) as value\n FROM ' + table + '\n WHERE itemid IN (' + itemids + ')\n AND clock > ' + timeFrom + ' AND clock < ' + timeTill + '\n GROUP BY time_sec DIV ' + intervalSec + ', metric\n ';
query = compactSQLQuery(query);
return _this.invokeSQLQuery(query);
});
@@ -132,6 +133,10 @@ System.register(['angular', 'lodash'], function (_export, _context) {
return _.sortBy(grafanaSeries, 'target');
}
function compactSQLQuery(query) {
return query.replace(/\s+/g, ' ');
}
return {
setters: [function (_angular) {
angular = _angular.default;

File diff suppressed because one or more lines are too long