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

Added ILIKE (case-insensitive for Postgres) #72

Closed
wants to merge 1 commit into from

Conversation

marcotroisi
Copy link

No description provided.

@vlucas
Copy link
Collaborator

vlucas commented Mar 12, 2015

There needs to be a test that uses this. Seeing as this is a Postgres-only feature, the differences need to be handled somehow. MySQL is case-insensitive by default, so it could just be an alias for "LIKE" for MySQL, but I am not sure about SQLite.

@marcotroisi
Copy link
Author

It looks like the best way to 'port' this to SQLite would be to use the
COLLATE NOCASE function.
On 12 Mar 2015 19:13, "Vance Lucas" notifications@github.com wrote:

There needs to be a test that uses this. Seeing as this is a Postgres-only
feature, the differences need to be handled somehow. MySQL is
case-insensitive by default, so it could just be an alias for "LIKE" for
MySQL, but I am not sure about SQLite.


Reply to this email directly or view it on GitHub
#72 (comment).

@vlucas
Copy link
Collaborator

vlucas commented May 4, 2016

This can now be achieved via the new addWhereOperator method added in PR #161.

\Spot\Query::addWhereOperator(':ilike', function ($builder, $column, $value) {
    return $column . ' ILIKE ' . $builder->createPositionalParameter($value);
});

@vlucas vlucas closed this May 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants