-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support ilike for Postgres #4628
Comments
Hi @gstreetmedia! It looks like you missed a step or two when you created your issue. Please edit your comment (use the pencil icon at the top-right corner of the comment box) and fix the following:
As soon as those items are rectified, post a new comment (e.g. “Ok, fixed!”) below and we'll take a look. Thanks! *If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected] |
Sorry to be a hassle, but it looks like your issue is still missing some required info. Please double-check your initial comment and try again. *If you feel this message is in error, or you want to debate the merits of my existence (sniffle), please contact [email protected] |
Ok, fixed |
hey @gstreetmedia for some use-cases, you may be able to solve this by normalizing your data going into the database (or coming out out of it). This would work well with something like email addresses. But if this issue comes up a lot, and a high-quality search is important for the group you are working with, you can use something like elasticsearch (grab from npm and you can integrate in with sails, not waterline) |
@gstreetmedia @oaksofmamre Hey everyone, we're moving all the Waterline issues from to Sails (balderdashy/sails) for closer management of issues and exposure to the community. I see one response to the original questions, however feel free to let us know if this issue is still pending a resolution. Otherwise, thanks for all the help so far. |
I just ran into this issue - I want to search my database for a customer's name - unfortunately searching for "testing" using the model's find-where-contains yields a query of "WHERE lastName LIKE '%testing%'" which doesn't match "Testing" because postgres LIKE is case-sensitive. How can I force an "ILIKE" instead of "LIKE" ? |
Hi @gstreetmedia like @illz suggested with Sails V1 when it comes to case sensitivity your best option is to use a native query. Please check out this gitter chat where Mike explains the reasoning. Also if you haven't checked-out the gitter group before, you should! It's Sails most active community platform. |
This would be helpful. Would be happy to raise a pull request for this |
@abitoprakash We'd be happy to take a look at a PR for this! |
Thanks for the update, @eashaw! I'd be happy to contribute. Since |
That's a great observation. Can you share how the userland API will be for this? |
@DominusKelvin, I was thinking we could follow the approach used in An example would be
|
Oh I think I love that API, can we also add it globally via datastore.js? |
Thanks @DominusKelvin, I think we can add it in |
Hi guys, any updates on this? |
Hey all I haven't had the time review yet but I will this Friday! |
Waterline version:0.13.4
Node version:8.9
NPM version:5.0
Operating system:All
waterline/utils/query/private/normalize-constraint.js should support ILIKE. This would be a super simple change the the existing 'like' condition.
A simple update to:
else if (modifierKind === 'like' || modifierKind === 'ilike') {
The text was updated successfully, but these errors were encountered: