Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support dart3, fix queryRaw for InfluxDB Cloud #124

Merged
merged 7 commits into from
May 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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