[Dbix-class] search() with "cmp" attribute

apv apv at sedition.com
Sat Jan 7 21:04:38 CET 2006


This was on my mind last week too. But I think the thing I wish it
were there for isn't so easy to get around:
  { logic => 'and' }
  { logic => 'or' }
What's the right way to do that through DBIC?

-Ashley

On Saturday, January 7, 2006, at 11:24  AM, Matt S Trout wrote:

> On Sat, Jan 07, 2006 at 06:08:07PM +0000, Will Hawes wrote:
>> I'm moving from Class::DBI::Sweet to DBIx::Class. One of the features 
>> I
>> find really useful in Sweet is the ability to do
>>
>> $class->search( {...}, { cmp => 'like' });
>>
>> instead of using a separate method e.g. search_like().
>>
>> Any reason why this isn't supported in DBIx::Class? If not, could it 
>> be
>> added please?
>
> Because of the degree of SQL::Abstract magic involved we don't pass 
> attrs
> to the S::A object directly. Simply doing
>
> $class->search( { foo => { 'like', '%something%' }, ... } );
>
> will work fine though.
>
> -- 
>      Matt S Trout       Offering custom development, consultancy and 
> support
>   Technical Director    contracts for Catalyst, DBIx::Class and BAST. 
> Contact
> Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more 
> information
>
>  + Help us build a better perl ORM: 
> http://dbix-class.shadowcatsystems.co.uk/ +
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
>
>




More information about the Dbix-class mailing list