-
Notifications
You must be signed in to change notification settings - Fork 129
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
fix: Fix support for InfluxDB 1.8.x in InfluxQLQueryAPI #459
fix: Fix support for InfluxDB 1.8.x in InfluxQLQueryAPI #459
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
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 test
completes successfully