fix: Fix support for InfluxDB 1.8.x in InfluxQLQueryAPI#459
Merged
btasker merged 3 commits intoinfluxdata:masterfrom Oct 26, 2022
Merged
fix: Fix support for InfluxDB 1.8.x in InfluxQLQueryAPI#459btasker merged 3 commits intoinfluxdata:masterfrom
btasker merged 3 commits intoinfluxdata:masterfrom
Conversation
InfluxQL queries will be sent as a urlencoded form-body as 1.8.x does not support use of the `application/vnd.influxql` mime-type
bednar
requested changes
Oct 26, 2022
Contributor
bednar
left a comment
There was a problem hiding this comment.
Thanks for your PR 👍
Please add test for your changes:
@Test
void testInfluxDB18() {
// create database
String db = "testing_database";
influxDBQuery("CREATE DATABASE " + db, db);
// connect to InfluxDB 1.8
influxDBClient.close();
influxDBClient = InfluxDBClientFactory.createV1(getInfluxDbUrl(), "username", "password".toCharArray(),
db, "autogen");
influxQLQueryApi = influxDBClient.getInfluxQLQueryApi();
// test query to InfluxDB 1.8
InfluxQLQueryResult result = influxQLQueryApi.query(new InfluxQLQuery("SHOW DATABASES", db));
assertSingleSeriesRecords(result)
.map(record -> record.getValueByKey("name"))
.contains(db);
// drop database
influxDBQuery("DROP DATABASE " + db, db);
}to
Adds test for InfluxQL queries against a 1.8 instance. Credit to @bednar
Codecov ReportBase: 88.40% // Head: 88.40% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #459 +/- ##
=========================================
Coverage 88.40% 88.40%
Complexity 777 777
=========================================
Files 172 172
Lines 7014 7014
Branches 378 378
=========================================
Hits 6201 6201
Misses 693 693
Partials 120 120 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Switches to sending InfluxQL queries as a urlencoded form-body to ensure compatibility with 1.8.x's InfluxQL implementation.
See (#458)
Checklist
mvn testcompletes successfully