Commit 08e816a5 by Mark Bell

Add support for regex based series merging in InfluxDB

parent 79c5d48a
...@@ -18,7 +18,7 @@ function () { ...@@ -18,7 +18,7 @@ function () {
var query = 'select '; var query = 'select ';
var seriesName = target.series; var seriesName = target.series;
if(!seriesName.match('^/.*/')) { if(!seriesName.match('^/.*/') && !seriesName.match(/^merge\(.*\)/)) {
seriesName = '"' + seriesName+ '"'; seriesName = '"' + seriesName+ '"';
} }
......
...@@ -44,6 +44,35 @@ define([ ...@@ -44,6 +44,35 @@ define([
}); });
describe('merge function detection', function() {
it('should not quote wrap regex merged series', function() {
var builder = new InfluxQueryBuilder({
series: 'merge(/^google.test/)',
column: 'value',
function: 'mean'
});
var query = builder.build();
expect(query).to.be('select mean(value) from merge(/^google.test/) where $timeFilter ' +
'group by time($interval) order asc');
});
it('should quote wrap series names that start with "merge"', function() {
var builder = new InfluxQueryBuilder({
series: 'merge.google.test',
column: 'value',
function: 'mean'
});
var query = builder.build();
expect(query).to.be('select mean(value) from "merge.google.test" where $timeFilter ' +
'group by time($interval) order asc');
});
});
}); });
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment