Re: Method Names (was: Stolen Ideas)

[prev] [thread] [next] [Date index for 2004/08/14]

From: Jay Strauss
Subject: Re: Method Names (was: Stolen Ideas)
Date: 16:35 on 14 Aug 2004
> > select * from table where upper(first_name) = ?;
> > my $builtin = q[upper(first_name)];
> > my @rows = $class->search(\$builtin => "BEATLES");
> 
> That's not going to cope very well where you have custom accessor
> names...
> 

Ok :) 

how about something like:

where the 2nd element of the array is always the CDBI column
my $bypass = ["upper(","first_name",")"];
my @rows =  $class->search(\$bypass => "BEATLES");

Or you could do it like:

my $bypass = {first_name => [qw/upper( )/]};
my @rows =  $class->search(\$bypass => "BEATLES");


Though it's getting kinda clumsy, you need need a way
to get at the column_name directly, so you can run it through
accessor_name if necessary

But would let you do nested, more complicated stuff like (find 
the rows where they are due in Sept:

my $bypass = 
 ["to_date(",
    ["nvl(","due_date",",to_date('2004/12/31','yyyy/mm/dd'))"],
   q{'mm'}];

my @rows = $class->search(\$bypass => 9);

Jay

(message missing)

Method Names (was: Stolen Ideas)
Jay Strauss 14:20 on 11 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tony Bowden 22:14 on 11 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 15:04 on 12 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tony Bowden 15:54 on 12 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 15:11 on 13 Aug 2004

Re: Method Names (was: Stolen Ideas)
Jay Strauss 16:35 on 14 Aug 2004

Pass a DBI Object?
Brian E. Lozier 18:22 on 14 Aug 2004

Re: Method Names (was: Stolen Ideas)
Tim Bunce 11:54 on 18 Aug 2004

Re: Pass a DBI Object?
Branislav Zahradnik 15:04 on 18 Aug 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52