mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
influxdb: another minor refactor of #9474
This commit is contained in:
@@ -49,16 +49,18 @@ export class InfluxQueryBuilder {
|
|||||||
} else if (type === 'FIELDS') {
|
} else if (type === 'FIELDS') {
|
||||||
measurement = this.target.measurement;
|
measurement = this.target.measurement;
|
||||||
policy = this.target.policy;
|
policy = this.target.policy;
|
||||||
|
|
||||||
if (!measurement.match('^/.*/')) {
|
if (!measurement.match('^/.*/')) {
|
||||||
measurement = '"' + measurement + '"';
|
measurement = '"' + measurement + '"';
|
||||||
if (policy) {
|
|
||||||
if (!policy.match('^/.*/')) {
|
if (policy && policy !== 'default') {
|
||||||
policy = '"' + policy + '"';
|
policy = '"' + policy + '"';
|
||||||
}
|
|
||||||
measurement = policy + '.' + measurement;
|
measurement = policy + '.' + measurement;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'SHOW FIELD KEYS FROM ' + measurement;
|
return 'SHOW FIELD KEYS FROM ' + measurement;
|
||||||
|
|
||||||
} else if (type === 'RETENTION POLICIES') {
|
} else if (type === 'RETENTION POLICIES') {
|
||||||
query = 'SHOW RETENTION POLICIES on "' + this.database + '"';
|
query = 'SHOW RETENTION POLICIES on "' + this.database + '"';
|
||||||
return query;
|
return query;
|
||||||
@@ -70,9 +72,7 @@ export class InfluxQueryBuilder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (policy && policy !== 'default') {
|
if (policy && policy !== 'default') {
|
||||||
if (!policy.match('^/.*/') && !policy.match(/^merge\(.*\)/)) {
|
policy = '"' + policy + '"';
|
||||||
policy = '"' + policy + '"';
|
|
||||||
}
|
|
||||||
measurement = policy + '.' + measurement;
|
measurement = policy + '.' + measurement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user