Skip to content

Commit

Permalink
update version to 1.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hagen1778 committed Feb 3, 2019
1 parent 731768f commit bcc1877
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 16 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# 1.8.1 (2019-02-01)

## New features:

* Add `timeFilterByColumn` macro (thx to @simPod) #68

## Fixes:

* add requestId to queries so that abandoned one are cancelled (thx to @nvartolomei)
* bug with parentheses in `$unescape` macros #90
* bug with treating string as numbers in table view #97


# 1.8.0 (2018-11-07)

## New features

* new $perSecond and $perSecondColumns macros (thx to @simPod) #78 #80
* Date column is now optional #48

## Fixes:

* extend queried timerange for queries with round option to provide a graph without gaps in the rightmost and leftmost points #84
* adhocs: check whether it is possibly to apply filters by comparing with parsed query or query builder settings #86


# 1.7.0 (2018-09-05)

## New Features
Expand Down
26 changes: 26 additions & 0 deletions dist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
# 1.8.1 (2019-02-01)

## New features:

* Add `timeFilterByColumn` macro (thx to @simPod) #68

## Fixes:

* add requestId to queries so that abandoned one are cancelled (thx to @nvartolomei)
* bug with parentheses in `$unescape` macros #90
* bug with treating string as numbers in table view #97


# 1.8.0 (2018-11-07)

## New features

* new $perSecond and $perSecondColumns macros (thx to @simPod) #78 #80
* Date column is now optional #48

## Fixes:

* extend queried timerange for queries with round option to provide a graph without gaps in the rightmost and leftmost points #84
* adhocs: check whether it is possibly to apply filters by comparing with parsed query or query builder settings #86


# 1.7.0 (2018-09-05)

## New Features
Expand Down
2 changes: 1 addition & 1 deletion dist/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "1.8.0"
"version": "1.8.1"
}
}
1 change: 1 addition & 0 deletions dist/sql_query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ export default class SqlQuery {
static clickhouseOperator(value: any): any;
static clickhouseEscape(value: any, variable: any): any;
static unescape(query: any): any;
static betweenBraces(query: any): any;
}
35 changes: 29 additions & 6 deletions dist/sql_query.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/sql_query.js.map

Large diffs are not rendered by default.

36 changes: 30 additions & 6 deletions dist/sql_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -542,16 +542,40 @@ export default class SqlQuery {
let macros = '$unescape(';
let openMacros = query.indexOf(macros);
while (openMacros !== -1) {
let closeMacros = query.indexOf(')', openMacros);
if (closeMacros === -1) {
throw {message: 'unable to find closing brace for $unescape macros: ' + query.substring(0, openMacros)};
let r = SqlQuery.betweenBraces(query.substring(openMacros+macros.length, query.length));
if (r.error.length > 0) {
throw {message: '$unescape macros error: ' + r.error};
}
let arg = query.substring(openMacros + macros.length, closeMacros)
.trim();
let arg = r.result;
arg = arg.replace(/[']+/g, '');
query = query.substring(0, openMacros) + arg + query.substring(closeMacros + 1, query.length);
let closeMacros = openMacros + macros.length + r.result.length + 1;
query = query.substring(0, openMacros) + arg + query.substring(closeMacros, query.length);
openMacros = query.indexOf('$unescape(');
}
return query
}

static betweenBraces(query): any {
let r = {
result: "",
error: "",
};
let openBraces = 1;
for (let i = 0; i < query.length; i++) {
if (query.charAt(i) === '(') {
openBraces++;
}
if (query.charAt(i) === ')') {
openBraces--;
if (openBraces === 0) {
r.result = query.substring(0, i);
break;
}
}
}
if (openBraces > 1) {
r.error = "missing parentheses"
}
return r
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vertamedia-clickhouse",
"version": "1.8.0",
"version": "1.8.1",
"description": "ClickHouse datasource for Grafana",
"scripts": {
"build": "grunt",
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"url": "https://github.com/Vertamedia/clickhouse-grafana"
}
],
"version": "1.8.0"
"version": "1.8.1"
}
}

0 comments on commit bcc1877

Please sign in to comment.