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

fix: uniform client API #31

Merged
merged 20 commits into from
Aug 10, 2023
Merged

Conversation

alespour
Copy link
Contributor

@alespour alespour commented Aug 3, 2023

Proposed Changes

  • Repackaged influx -> influxdb3
  • Uniform client API, mainly
    • Configs -> ClientConfig
      • HostUrl -> Host
      • AuthToken -> Token
    • WriteParams -> WriteOptions
      • Consistency removed (not supported by 3.x)
    • Query method has sibling method QueryWithOptions with additional parameter of QueryOptions type, which allows to specify database and query type (like eg. in Java client)
    • WriteXXX methods has variants with WriteXXXWithOptions with parameter of WriteOptions type, which allows to specify database and precision (like eg. in Java client)

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)

@alespour alespour changed the base branch from main to feat/custom-headers August 3, 2023 15:03
@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #31 (7445c91) into feat/custom-headers (55fd7c9) will increase coverage by 2.03%.
The diff coverage is 78.17%.

@@                   Coverage Diff                   @@
##           feat/custom-headers      #31      +/-   ##
=======================================================
+ Coverage                79.32%   81.35%   +2.03%     
=======================================================
  Files                        8        9       +1     
  Lines                      532      574      +42     
=======================================================
+ Hits                       422      467      +45     
+ Misses                      95       93       -2     
+ Partials                    15       14       -1     
Files Changed Coverage Δ
influxdb3/point.go 100.00% <ø> (ø)
influxdb3/reflection.go 50.00% <ø> (ø)
influxdb3/query_iterator.go 43.26% <43.26%> (ø)
influxdb3/query.go 81.81% <81.81%> (ø)
influxdb3/write.go 97.56% <97.56%> (ø)
influxdb3/client.go 91.58% <100.00%> (ø)
influxdb3/error.go 100.00% <100.00%> (ø)
influxdb3/fix_url.go 100.00% <100.00%> (ø)
influxdb3/query_type.go 100.00% <100.00%> (ø)

@alespour alespour marked this pull request as ready for review August 4, 2023 14:25
@alespour alespour requested a review from bednar August 4, 2023 14:25
Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

Thanks again for your PR 👍
There are a few requirements that must be satisfied before we accept the PR:

  1. Please update README.md to new naming

and also:

influxdb3/config.go Outdated Show resolved Hide resolved
influxdb3/error.go Outdated Show resolved Hide resolved
influxdb3/query.go Outdated Show resolved Hide resolved
@alespour alespour requested a review from bednar August 9, 2023 11:52
Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

Thanks again for your PR 👍
There are a few requirements that must be satisfied before we accept the PR:

example/main.go Show resolved Hide resolved
influxdb3/query.go Outdated Show resolved Hide resolved
Copy link
Member

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🍻

@alespour alespour merged commit 27429d2 into feat/custom-headers Aug 10, 2023
3 of 4 checks passed
@alespour alespour deleted the fix/uniform-client-api branch August 10, 2023 08:06
alespour added a commit that referenced this pull request Aug 10, 2023
* feat: add custom default HTTP headers support

* fix: uniform client API (#31)

* refactor: change package to influxdb3

* refactor: add query and write methods with options

* fix: remove Query method parameter with unclear meaning and no tests

Co-authored-by: Jakub Bednář <jakub.bednar@gmail.com>
@alespour alespour mentioned this pull request Aug 10, 2023
6 tasks
@bednar bednar added this to the 0.2.0 milestone Aug 11, 2023
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.

2 participants