Skip to content

v2.0 compatibility#14

Open
wardgssens wants to merge 2 commits intoEnricSala:masterfrom
wardgssens:v2-compatibility
Open

v2.0 compatibility#14
wardgssens wants to merge 2 commits intoEnricSala:masterfrom
wardgssens:v2-compatibility

Conversation

@wardgssens
Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant