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

Optimize search to ignore on empty string #43

Conversation

jotaviobiondo
Copy link
Member

This PR intends to optimize a little the query generated when using Crudry.Query.search/3.

But this is possibly a breaking change, since before this change, with an empty search_term, the rows that have null values for any of the columns specified in fields were being filtered out. With this PR, the rows with null values will be returned too.

What do you guys think, should we proceed with this change?

@gabrielpra1
Copy link
Member

It's hard to define what is the expected behaviour here, but I think it's reasonable to assume that searching by an empty string shouldn't impact the result of the query, so I would say that this could enter as a minor version bump. What do you think @jotaviobiondo?

@jotaviobiondo
Copy link
Member Author

jotaviobiondo commented May 24, 2021

I agree! Maybe document it also as a bug fix? since it changes the current behavior

@gabrielpra1 gabrielpra1 merged commit 57193b8 into jungsoft:master Jun 4, 2021
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