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(datastore): adds in, not-in, and != query operations #5975

Merged
merged 15 commits into from May 6, 2022

Conversation

telpirion
Copy link
Contributor

@telpirion telpirion commented May 2, 2022

BEGIN_COMMIT_OVERRIDE
chore: adds in, not-in, and != query operations
END_COMMIT_OVERRIDE

@product-auto-label product-auto-label bot added size: s Pull request size is small. api: datastore Issues related to the Datastore API. labels May 2, 2022
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels May 3, 2022
@telpirion telpirion requested a review from enocom May 3, 2022 19:40
@telpirion telpirion marked this pull request as ready for review May 4, 2022 21:22
@telpirion telpirion requested review from dmahugh, tritone and a team as code owners May 4, 2022 21:22
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Overall LGTM, a couple minor ideas/suggestions.

datastore/query.go Outdated Show resolved Hide resolved
datastore/query.go Outdated Show resolved Hide resolved
datastore/query.go Outdated Show resolved Hide resolved
@telpirion telpirion requested review from tritone, tbpg and kolea2 May 5, 2022 17:53
datastore/query.go Outdated Show resolved Hide resolved
datastore/query_test.go Outdated Show resolved Hide resolved
datastore/query_test.go Outdated Show resolved Hide resolved
telpirion and others added 3 commits May 5, 2022 12:34
Co-authored-by: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com>
Co-authored-by: Tyler Bui-Palsulich <26876514+tbpg@users.noreply.github.com>
@telpirion telpirion requested a review from tbpg May 5, 2022 21:21
// Fields are compared against the provided value using the operator.
// Multiple filters are AND'ed together.
// Field names which contain spaces, quote marks, or operator characters
// should be passed as quoted Go string literals as returned by strconv.Quote
// or the fmt package's %q verb.
func (q *Query) Filter(filterStr string, value interface{}) *Query {
q = q.clone()
// TODO( #5977 ): Add better string parsing (or something)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The comment? The TrimRight() technique of parsing the input filterStr seems like it could introduce unwanted side effects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants