influxdb-matlab icon indicating copy to clipboard operation
influxdb-matlab copied to clipboard

v2.0 compatibility

Open wardgssens opened this issue 4 years ago • 0 comments
trafficstars

I read the issue about compatibility with InfluxDB v2.0. As I needed this solved for my bachelor's thesis, I started on it myself. I copied the InfluxDB class and made the necessary changes to write and query data. By duplicating the existing class, all other code could be reused.

When the InfluxDB instance is created or the database is changed, a DataBase Retention Policy mapping is created to map the provided database name to a bucket with the same name. Before creating a new one, all existing mappings associated with the new database name are deleted to prevent any issues. This part is the only part that uses the new v2.0 API.

Next, I changed the runWrite, runQuery, and runCommand to use token-based authorization.

I didn't know how to write correct tests, but I tested writing and querying manually and everything seemed to work. My test script is provided as an example.

wardgssens avatar Apr 20 '21 12:04 wardgssens