When using the Select API is there a global setting that can be set to default to case insensitive searches in queries like this one for PostgreSQL:
var res = Db.Select<CustomerProperties>(cp => cp.Description.Contains("name"));
SQL: SELECT "id", "customer_id", "description"
FROM "customer_properties"
WHERE "description" like :0
PARAMS: :0=%name%
Basically, making all like ILIKE by default.
When using autoquery I’m using QueryDbField like so to work around this:
Here is another query. I have a tenant description stored like so:
mythz in lower case returns no result:
var notWorking = Db.Select<TenantProperties>(x => x.Description.Contains("mythz"));
dbug: ServiceStack.OrmLite.OrmLiteReadCommandExtensions[0]
SQL: SELECT "id", "description"
FROM "tenant_properties"
WHERE "description" like :0
PARAMS: :0=%mythz%
I don’t see upper anywhere in the generated SQL…?
To get the record, I need to capitalize the M in mythz in the string:
var works = Db.Select<TenantProperties>(x => x.Description.Contains("Mythz"));
dbug: ServiceStack.OrmLite.OrmLiteReadCommandExtensions[0]
SQL: SELECT "id", "description"
FROM "tenant_properties"
WHERE "description" like :0
PARAMS: :0=%Mythz%
From you previous answer I understood that .Contains should have injected upper() somewhere in the query and that