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(filter): Implement wild card searching for issue #95 #131

Merged
merged 3 commits into from
Aug 12, 2024

Conversation

michalkrzyz
Copy link
Collaborator

  • Add search filter for wildcard-like searching
  • Add compose makefile targets

- Add search filter for wildcard-like searching
- Add compose makefile targets

Signed-off-by: Michal Krzyz <[email protected]>
Copy link
Collaborator

@drochow drochow left a comment

Choose a reason for hiding this comment

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

Looks very good to me! I just got one question where I do understand the change.

Comment on lines +173 to +175
for i := 0; i < count; i++ {
params = append(params, item)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you explain why we need to do this?

Copy link
Collaborator Author

@michalkrzyz michalkrzyz Aug 9, 2024

Choose a reason for hiding this comment

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

This is used because Wild Card query has multiple logical statements with the same parameter, here is pseudo code we are using:
'WHERE ....some previous conditions... AND (primName LIKE searchParam OR secName LIKE searchParam) AND ...

search param is the same for every single element from search list of filters. It is passed currently through two SQL Query parameters passed by question marks per search element. In all other filters, we have only single question marks used.
We could add extra SET Sql keyword to set every parameter to some value but it will complicate the design a bit, but I am open for discussion.

Meanwhile I will try to find better name for this function I have added to database.go.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ahh thanks for explaining

@drochow
Copy link
Collaborator

drochow commented Aug 9, 2024

@MR2011 please take second look! Looks good to me!

@drochow drochow merged commit 547d0b8 into main Aug 12, 2024
4 checks passed
@drochow drochow deleted the mikrzyz/issue-95 branch August 12, 2024 11:34
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