sendgrid / eventkit-rails

An open source project for integrating with SendGrid's Event Webhook.
Open Software License 3.0
53 stars 73 forks source link

Changing LIKE queries to ILIKE to allow for case insensitive searching #12

Open knightpfhor opened 9 years ago

knightpfhor commented 9 years ago

I've been caught out while copy/pasting email addresses and additional arguments not finding results because the source had a different case to how it had been passed to SendGrid in the first place. Using ILIKE instead of LIKE seems to solve the problem (even if it is unique to POSTGRESQL, I'm not sure if that's a problem for this project or not)

SampsonCrowley commented 4 years ago

ILIKE is not specific to postgres I'm pretty sure. And email itself is also supposed to be case insensitive. It might be better to specifically downcase all emails in the query, and create an index on it

SampsonCrowley commented 4 years ago

Either way searches shouldn't be case sensitive