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

Consolidate/update schema queries #51

Merged
merged 5 commits into from
Jan 30, 2024
Merged

Consolidate/update schema queries #51

merged 5 commits into from
Jan 30, 2024

Conversation

poster515
Copy link
Contributor

Per the docs there is an optional 'start' value, in negative days, that can be added to schema queries. This PR:

  • adds an optional param to those functions dictating the start of the search
  • implements the 'measurementTagKeys' function
  • consolidates the schema query execution because they were all identical

Tested on my local influx server with Some() and None values

Also adding 'list_measurement_tag_keys' for completeness. Note that
this does break backwards compatibility but rust doesn't support
optional func params- adding 'None' to schema queries will make them
backwards compatible though.
aprimadi
aprimadi previously approved these changes Jan 30, 2024
Copy link
Owner

@aprimadi aprimadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thank you for the pull request.

@aprimadi aprimadi dismissed their stale review January 30, 2024 00:06

Failing build

@aprimadi
Copy link
Owner

Can you fix the build cargo fmt and I will review again.

@poster515
Copy link
Contributor Author

Can you fix the build cargo fmt and I will review again.

yeah sorry I missed that. thanks for the quick review

Copy link
Owner

@aprimadi aprimadi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@aprimadi aprimadi merged commit 48797a3 into aprimadi:main Jan 30, 2024
1 check passed
pub async fn list_measurements(
&self,
bucket: &str,
days_ago: Option<i64>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit late to this PR, but I'd like to note that this introduces a backwards incompatible change to anyone using one of these 3 functions.

Backwards compatibility could be maintained by restoring the original functions and adding new functions with the extra param. Alternatively (and this would be my preference) we could mention it in the release notes

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Boudewijn26 that's a valid point, I'll yank version 0.4.6 and bump minor version to v0.5 and create a release note, bumping major version seems to be unnecessary since we haven't reach v1 yet.

Also a clean up seems necessary like perhaps introducing both start and stop optional parameter so that it more closely resembles the API documentation.

I'll do this either today or tomorrow.

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.

3 participants