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

Matt S Trout dbix-class at trout.me.uk
Sat Jan 7 20:24:15 CET 2006


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/ +



More information about the Dbix-class mailing list