@patrick, +1 for @Eldynn request (add custom threatment to query builder).
I have paged queries that is hard to make by hand via Custom Queries and I (we) want to search case insensitive.
I think that the best possible workaround is to edit the Server Action JSON file in order to take advantage of default behavior in db.js:
...
} else if (rule.operator == 'contains') {
this[where](column, 'like', '%' + rule.value + '%');
} else if (rule.operator == 'not_contains') {
this[where + 'Not'](column, 'like', '%' + rule.value + '%');
} else {
this[where](column, rule.operation, rule.value);
}
So, I have modified my Contain Clause from:
{
"id": "users.name",
"field": "users.name",
"type": "string",
"operator": "contains",
"value": "{{$_GET.search.default('%')}}",
"data": {
"table": "users",
"column": "name",
"type": "text"
},
"operation": "LIKE"
}
Changing operator to “custom”, operation to “ILIKE” and added “%” to value begin and end:
{
"id": "users.name",
"field": "users.name",
"type": "string",
"operator": "custom",
"value": "{{'%' + $_GET.search + '%'}}",
"data": {
"table": "users",
"column": "name",
"type": "text"
},
"operation": "ILIKE"
}
Query Builder doesn’t support this, actually:
So, if you allow adding custom operator OR a raw query clause in conditions tab would be awesome!