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

CHANGED where/like clause is now case-insensitive #464

Closed
wants to merge 1 commit into from
Closed

CHANGED where/like clause is now case-insensitive #464

wants to merge 1 commit into from

Conversation

mifkata
Copy link

@mifkata mifkata commented Aug 21, 2017

No description provided.

@mdconaway
Copy link

mdconaway commented Sep 13, 2017

This would be a nice feature to merge into main.

I understand some people may also want the ability to toggle case sensitivity at the adapter or query level. (Which is not solved in this pull request)

What do you think @sgress454 or @mikermcneil ?

P.S. To clarify my above statement, this shouldn't be merged in as-is. It would likely need to ship with some level of support enabling/disabling the feature, however the waterline team would like to see that happen.

@mikermcneil
Copy link
Member

@clickbuster @mdconaway Hmm, this one is interesting because it's already being implemented via a regexp anyway. One solution would be a Mongo-specific meta key (e.g. .meta({makeLikeModifierCaseInsensitiveInMongo: true}). Of course, that'd get annoying to type pretty quickly (but it could always be wrapped up in a userland helper.)

Another option would be a more standardized flag. This'd have the advantage of us being able to boil it up into a model setting (which would mean you'd only have to change one file in your app to switch everything between case-sensitive and case-insensitive like/contains/startsWith/endsWith queries).

I tracked this in the roadmap here

@mifkata
Copy link
Author

mifkata commented Oct 2, 2017

@mikermcneil I don't see a reason why LIKE shouldn't be case-insensitive, since you can always query with '%search%' to get exactly the same case-sensitive result. Also, in most databases the LIKE functionality, where available, is case-insensitive. The problem with adding a meta, is that it won't be a standard property for every adapter and may cause major issues when switching from one adapter to another.

@daviddang91
Copy link

This is a great feature. Thanks.

@luislobo
Copy link
Contributor

@rachaelshaw This should be closed as it's resolved

@mifkata
Copy link
Author

mifkata commented Mar 29, 2021

@luislobo @rachaelshaw I'm closing the PR in favour of balderdashy/sails#7014 (comment) Thanks

@mifkata mifkata closed this Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants