RE: [Dbix-class] lower on column and query

2008-03-03 Thread Peter Edwards
I found a solution equal to Jonathan's one which is : my $search = $c-req-param('extactmatch') ? 'search' : 'search_like'; $q = lc($q); my $rs = $c-model(DB::Dbentry)-$search({ 'lower('.$key.')' = $q }, I think you may need to escape an interpolated LHS variable like $key with DBI::escape() or

Re: [Dbix-class] lower on column and query

2008-03-02 Thread Emmanuel Quevillon
Emmanuel Quevillon wrote: Hi, I'd like to perform a query where I'd like to cal SQL funciton on : select * from foo where lower(field) = lower(query). So I wondered if from a ResultSet::search method I could pass attribute like 'case = lower' as described in SQL::Abstract::new method? BTW,

Re: [Dbix-class] lower on column and query

2008-03-01 Thread Moritz Onken
Interestingly, I thought about the same problem yesterday, I was looking at the difference of LIKE in postgres and mysql. Seems like LIKE in postgres is case sensitive and in mysql it's not. So you have to use ILIKE in postgres to get the same behaviour as LIKE in mysql. To make an

[Dbix-class] lower on column and query

2008-02-29 Thread Emmanuel Quevillon
Hi, I'd like to perform a query where I'd like to cal SQL funciton on : select * from foo where lower(field) = lower(query). So I wondered if from a ResultSet::search method I could pass attribute like 'case = lower' as described in SQL::Abstract::new method? BTW, I am using PostGreSQL