Closed Infern1 closed 4 years ago
Thank you for reporting this issue and describing your workaround.
InfluxDB1.8 server now does not support influxql queries in 2.0 compatibility endpoints that are used by this client, the code accepts only flux queries.
The 2.0 documentation mentions only flux queries, even though the 2.0 API offers the influxql query option, the support of influxql in 2.0 is not documented, therefore it is not something to rely upon. Your query would fail also in 2.0:
$ curl -X POST -H "Authorization: Token ${INFLUX_TOKEN}" "${INFLUX_HOST}/api/v2/query?org=${INFLUX_ORG}" -d '{"type": "influxql", "query": "SHOW DATABASES", "bucket": "my-bucket"}'
// returns {"error":"interface conversion: interface {} is nil, not v1.DatabasesDependencies"}
This client shall be used to post flux
queries. Influxql queries returns json data that are neither recognized by this client nor documented in 2.0 API. The state of influxql support in 2.0 is unknown at the moment, it returns JSON data are not supported by this client anyway.
I would better remove the influxql
option from this client, so that we will not confuse users that influxql is the way that could be used to query the DB through this client.
Thanks for the clarification
I would better remove the
influxql
option from this client, so that we will not confuse users that influxql is the way that could be used to query the DB through this client.
Yes I agree
The reason for trying this client is the statement:
If you are just getting started with InfluxDB 1.x today, we recommend adopting the latest client libraries. They allow you to easily move from InfluxDB 1.x to InfluxDB 2.0 Cloud or open source, (when you are ready).
Since we already have an existing nodejs application using the current node-influx client I was thinking it would be nice to prepare our self for the new 2.0 series. Using the compatibility mode by using influxql
this would mean we don't have to rewrite all queries at once and can do it step by step and compare the results easily.
I will put our migration on hold for now, since we are running Influx on Windows environment and at the moment there are no binaries for 2.0. So no (easy) adoption for the 2.0 with Influx.
Issue can be closed from my point of view.
Expected Behavior
If I define type
influxql
I should be able to do a simple queryCurrent Behavior
Response with a bad request
const queryApi = this.influxClient.getQueryApi('').with({ type: 'influxql' });
Error log:
Possible Solution
Accept
influxql
since I want to do an easy query:SHOW DATABASES
since with 1.8 thebuckets()
doesn't work.I can get a proper response by:
Steps/Code to Reproduce the Problem
Specifications