Question

How can I do a case-insensitive search with Rose::DB::Object?

Here is the form of a Rose::DB::Object search:

my $my_matches = $_my_table_class_mgr->get_objects(
    query => [
        my_field => $my_value,
    ],
);

Is there something I can add to the "query" parameters, perhaps? But, I don't see anything that addresses this in here (in the Rose::DB::Object::QueryBuilder documentation).

What am I missing? And where is what I am missing documented?

Thank you!

Was it helpful?

Solution

I got it. It is quite simple. You have to do an 'imatch' operation in the query parameter. The code looks like this:

my $my_matches = $_my_table_class_mgr->get_objects(
    query => [
        my_field => {imatch => $my_value},
    ],
);

So, very simple solution.

I figured this out by studying the Rose::DB::Object::QueryBuilder documentation here. Look under the part where it says 'Comparisons:' and then, just beneath that, where it says '"OP" can be any of the following:'.

Thank you to anyone who might have considered helping with this. I hope it helps a future newbie to Rose::DB::Object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top