Query SQL data source from InfluxDB 2.0 and access to logs

When I follow this doc I am able to correctly query a PostgreSQL data source using the following

import "sql"
sql.from(
  driverName: "postgres",
  dataSourceName: "postgresql://username:password@localhost/mydb",
  query: "SELECT * FROM sensors"
)

When I use SQlite to create a test.db file with the same sensor table and sensor info and I change the DataSourceName to the one specified in the example I get “An internal error has occurred”. Not really an helpful error message.

import "sql"
sql.from(
  driverName: "sqlite3",
  dataSourceName: "file:test.db?cache=shared&mode=memory",
  query: "SELECT * FROM sensors"
)

Questions:

  • Where should I place the file test.db to be accessible to influx? the DataSourceName is relative to which path? I tried changing everything I could in dataSourceName without success.
  • How could I have access to more Influx beta logs? Maybe there is something there.

I am using InfluxDB 2.0 Beta 6 where influxd is located at /usr/local/bin/

Hi,

Apologies, but this isn’t possible with InfluxDB. The Flux process embedded inside of InfluxDB is sandboxed and doesn’t have access to the disk.

However, you can write your Flux and run it locally on your machine, and output or read from InfluxDB using the helpers for that.

There was a bug in the documentation, which I’ve submitted a PR for:

That is unfortunate. Thanks for your time and the video. It was interesting to see that you attempted all I tried (and more). In my understanding, having no access to disk is a design choice and thus I should not have hope for this feature to be added in the future. Am I correct? Maybe I better rely on PostgreSQL.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.