Skip to content
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

v2.0 compatibility #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wardgssens
Copy link

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