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 structured query #45

Merged
merged 13 commits into from
Nov 3, 2023
Merged

feat: add structured query #45

merged 13 commits into from
Nov 3, 2023

Conversation

bednar
Copy link
Member

@bednar bednar commented Oct 11, 2023

Closes #14
Closes #43
Closes #44

Proposed Changes

The user is able to query data into structured object and write this object back to database.

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • Tests pass
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@bednar bednar requested a review from Sciator October 11, 2023 13:48
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Attention: 46 lines in your changes are missing coverage. Please review.

Comparison is base (3cede62) 83.84% compared to head (8c5ed18) 82.89%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #45      +/-   ##
==========================================
- Coverage   83.84%   82.89%   -0.96%     
==========================================
  Files          10       11       +1     
  Lines         681      912     +231     
==========================================
+ Hits          571      756     +185     
- Misses         95      128      +33     
- Partials       15       28      +13     
Files Coverage Δ
influxdb3/query.go 82.08% <100.00%> (ø)
influxdb3/query_type.go 100.00% <ø> (ø)
influxdb3/write.go 97.65% <100.00%> (+0.09%) ⬆️
influxdb3/point.go 95.91% <94.00%> (-4.09%) ⬇️
influxdb3/query_iterator.go 50.70% <55.26%> (+1.66%) ⬆️
influxdb3/point_values.go 83.08% <83.08%> (ø)

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

@arukiidou
Copy link

please add SetUIntegerField.

@nrhvyc
Copy link

nrhvyc commented Nov 1, 2023

Why use Setter functions here instead of following the convention used by func (c *Client) WriteData{} which uses field tags? It's not like Values is a private field that would require a setter. Doesn't feel like idiomatic Go code.

type TemperatureSensor struct {
Measurement string lp:"measurement"
Sensor string lp:"tag,sensor"
ID string lp:"tag,device_id"
Temp float64 lp:"field,temperature"
Hum int lp:"field,humidity"
Time time.Time lp:"timestamp"
Description string lp:"-"
}

@bednar
Copy link
Member Author

bednar commented Nov 2, 2023

Hi @nrhvyc,

Thank you for your input. Could you please provide more details about your suggestion? I'm not sure I've fully understood what you are proposing. Any additional information you can provide would be helpful.

Best regards

@bednar
Copy link
Member Author

bednar commented Nov 2, 2023

@arukiidou

please add SetUIntegerField.

I will update this PR

@bednar bednar added this to the 0.4.0 milestone Nov 3, 2023
@bednar bednar merged commit c262f3e into main Nov 3, 2023
10 of 11 checks passed
@bednar bednar deleted the feat-query-structured branch November 3, 2023 07:41
@bednar
Copy link
Member Author

bednar commented Nov 3, 2023

@nrhvyc, please feel free to suggest improvements to the client. We are always happy to consider changes that will enhance usability for our community. Our minds are open. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants