Skip to content

Commit

Permalink
chore: support dart3, fix queryRaw for InfluxDB Cloud (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar authored May 29, 2023
1 parent 2529cac commit 79868dd
Show file tree
Hide file tree
Showing 5 changed files with 239 additions and 175 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## 2.9.0 [unreleased]

### Bug Fixes
1. [#124](https://github.com/influxdata/influxdb-client-dart/pull/124): `queryRaw` for InfluxDB Cloud

### Others
1. [#124](https://github.com/influxdata/influxdb-client-dart/pull/124): Add compatibility with Dart 3

## 2.8.0 [2022-12-01]

### Others
Expand Down
2 changes: 1 addition & 1 deletion lib/client/flux_transformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class FluxTransformer implements StreamTransformer<List, FluxRecord> {
}

var duplicates = table.columns.map((item) => item.label).toList();
duplicates.toSet().forEach((item) => {duplicates.remove(item)});
duplicates.toSet().forEach((item) => duplicates.remove(item));

if (duplicates.isNotEmpty) {
logPrint('The response contains columns with duplicated names:'
Expand Down
9 changes: 2 additions & 7 deletions lib/client/query_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,8 @@ class QueryService extends DefaultService {
query.params = params ?? query.params;
query.dialect = dialect ?? query.dialect;

var uri = _buildUri(influxDB.url!, '/api/v2/query', {'org': influxDB.org});
var body = jsonEncode(query);
Map<String, String> headers = {};
_updateParamsForAuth(headers);
var response = await _invoke(uri, 'POST',
headers: headers, body: body, maxRedirects: influxDB.maxRedirects);
return (response as Response).body;
var response = await _send('/api/v2/query', {'org': influxDB.org}, query);
return (response as StreamedResponse).stream.bytesToString();
}

/// Streams the result of [fluxQuery] using [Dialect].
Expand Down
Loading

0 comments on commit 79868dd

Please sign in to comment.