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

Equal operator typed helpers #62

Merged
merged 1 commit into from
Apr 28, 2022
Merged

Equal operator typed helpers #62

merged 1 commit into from
Apr 28, 2022

Conversation

efirs
Copy link
Collaborator

@efirs efirs commented Apr 28, 2022

No description provided.

@efirs efirs force-pushed the filter_helpers branch 2 times, most recently from 6d1c3f0 to 127b2a1 Compare April 28, 2022 00:25
@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2022

Codecov Report

Merging #62 (b97cc3b) into main (09a224c) will decrease coverage by 0.00%.
The diff coverage is 88.46%.

@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
- Coverage   85.32%   85.31%   -0.01%     
==========================================
  Files          12       13       +1     
  Lines        1131     1151      +20     
==========================================
+ Hits          965      982      +17     
- Misses        125      127       +2     
- Partials       41       42       +1     
Impacted Files Coverage Δ
schema/schema.go 91.16% <62.50%> (-1.09%) ⬇️
driver/internal.go 100.00% <100.00%> (ø)
filter/eq.go 100.00% <100.00%> (ø)
filter/filter.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 09a224c...b97cc3b. Read the comment docs.

filter/eq.go Outdated

// EqUint composes 'equal' operation from uint value.
// Result is equivalent to: field == value
func EqUint(field string, value uint) expr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to support uint? Let's stick to whatever types we support.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's automatically converted to our int32 and back, no need to limit users.
There is no support for Uint64 for example because we don't have enough precision to store it.

filter/eq.go Outdated

// EqUint32 composes 'equal' operation from uint32 value.
// Result is equivalent to: field == value
func EqUint32(field string, value uint32) expr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

^

@@ -29,6 +30,16 @@ const (
tagSkip = "-"
)

// PrimitiveFieldType represents types supported by non-composite fields
type PrimitiveFieldType interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

better restrict to our supported types.

@efirs efirs force-pushed the filter_helpers branch 2 times, most recently from 5444834 to 98e9fd6 Compare April 28, 2022 03:40
himank
himank previously approved these changes Apr 28, 2022
@efirs efirs merged commit b97cc3b into main Apr 28, 2022
@efirs efirs deleted the filter_helpers branch April 28, 2022 17:00
@github-actions
Copy link

🎉 This PR is included in version 1.0.0-alpha.9 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

🎉 This PR is included in version 1.0.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented May 9, 2023

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants