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

feat: add SQL query with named parameters #94

Merged
merged 8 commits into from
Feb 27, 2024

Conversation

alespour
Copy link
Contributor

@alespour alespour commented Jan 22, 2024

Proposed Changes

This PR add supports for named parameters in the query API:

try (Stream<PointValues> rows = client.queryPoints(
    "SELECT a, b, c FROM my_table WHERE id = $id AND name = $name",
    Map.of(
      "id", 1,
      "name", "test"
    )
);

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional

@bednar bednar force-pushed the feat/sql-query-named-parameters branch from dd7a246 to 7546413 Compare February 23, 2024 08:48
@bednar bednar marked this pull request as ready for review February 23, 2024 08:48
Copy link

codecov bot commented Feb 23, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 87.93%. Comparing base (bbd9b2f) to head (3601a5e).
Report is 6 commits behind head on main.

Files Patch % Lines
...nfluxdb/v3/client/internal/InfluxDBClientImpl.java 94.73% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   87.82%   87.93%   +0.11%     
==========================================
  Files          15       15              
  Lines         813      829      +16     
  Branches      116      117       +1     
==========================================
+ Hits          714      729      +15     
  Misses         44       44              
- Partials       55       56       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bednar bednar requested a review from karel-rehor February 23, 2024 12:45
Copy link
Contributor

Choose a reason for hiding this comment

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

Works, however on first usage got exceptions when the query was executed faster than the test data was written, apparently. I had to add a Thread.sleep after write on a subsequent run to get results. However, I cannot now recreate this issue.

Copy link
Member

Choose a reason for hiding this comment

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

It is probably caused by "slow" propagation of the new measurement on the server side.

Copy link
Contributor

@karel-rehor karel-rehor left a comment

Choose a reason for hiding this comment

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

Tests pass. However IOxExample had some timing issues on first use, which cannot now be recreated.

All other changes make sense.

@bednar bednar merged commit 7b1f93d into main Feb 27, 2024
9 checks passed
@bednar bednar deleted the feat/sql-query-named-parameters branch February 27, 2024 08:08
@bednar bednar added this to the 0.6.0 milestone Feb 27, 2024
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