[Catalyst] Support distinct in search() and search_like()

Pedro Melo melo at simplicidade.org
Mon Nov 7 22:44:12 CET 2005


hi,

On Nov 7, 2005, at 5:40 PM, Bill Moseley wrote:
> On Mon, Nov 07, 2005 at 04:56:03PM +0000, Pedro Melo wrote:
>> I needed Class::DBI::Sweet search() to use SELECT DISTINCT in one
>> project I'm working on.
>
> In trunk there's an option to pass in the name of the sql method to
> use instead of the default "Join_Retrieve".  With this you can define
> your custom selects in your base class (or in one of your table's
> classes) and tell Sweet to use that instead.

Looking at the C::D::Sweet code, is not clear to me what option is 
that. The code seems hardwired to the name Join_Retrieve.

Line 280 of C::D::Sweet looks like this in the original code:

     my $sth = $class->sql_Join_Retrieve( $pre_fields, $from, $sql );

So the name is hardwired. I suppose I could override sql_Join_Retrieve 
but it would use distinct on every query, not what I want.

Of course, if Sweet or C::DBI already has this, I would use it.

Thanks,
--
Pedro Melo
JID: melo at simplicidade.org




More information about the Catalyst mailing list