-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
While looking at the client-side implementation of LIKE, I noticed the following line:
if (matchExpression.Equals(pattern, StringComparison.OrdinalIgnoreCase))(the regex below similarly has RegexOptions.IgnoreCase).
Now, I don't know SqlServer or the SQL Standard that well, but I'm wondering about the "correct" default for LIKE case sensitivity. PostgreSQL LIKE is case-sensitive (and an alternative ILIKE exists for insensitive). At the very least Oracle seems to be case-sensitive by default as well.
Given that I'm popping this out a bit last minute with 2.0.0 around the corner, I'm guessing that at least the client-side implementation is going to remain case-insensitive. I'm wondering what you'd recommend for the Npgsql behavior: to align with the "default" EF Core behavior, I'd generate case-insensitive ILIKE clauses rather than LIKE. But to cause less surprise with PostgreSQL users who are used to LIKE being sensitive, EF.Functions.Like() should generate LIKE - and accept that there are going to be variations across providers with this kind of thing.
Let me know what you think.