Re: Class::DBI::Set

[prev] [thread] [next] [Date index for 2004/06/28]

From: steve shapero
Subject: Re: Class::DBI::Set
Date: 08:19 on 28 Jun 2004
hi Yuval--

funny, i was just going to post a question along these lines.  i'm 
wondering how i can setup CDBI so that i can do something like this:

my $Everything = Tracks->search_like(name => '%something') & 
Artists->search_like(name => '%else')

so that $Everything will give me all the tracks that have a name like 
'%something' that were made by artists with a name like '%else'.  how 
are people doing this?  it's not so useful for me to just search on one 
table.  Especially b/c i'd like to be able to this:

my $tracks = find_tracks(track_name => '%something', artist_name => 
'$else');

steve

On Jun 25, 2004, at 11:08 AM, Yuval Kogman wrote:

> Howdy...
>
> I'll be needing this for my project.
>
> 	my $smiths = Class::DBI::Set->new;
> 	$smiths->contraints( surname => "Smith" );
>
> 	my $johns = Class::DBI::Set->new;
> 	$johns->constraints( name => "John" );
>
> 	my $john_smiths = $john & $smith;
> 	$john_smiths->retrieve_all;
>
> Just your plain old, simple sets with CDBI. It should be a nice 
> project.
> But now the catch.
>
> I want to store a set in a database. As for the schema - i'm not
> worried. I'll cross that bridge when I get there. But how silly is it 
> to
> start wrapping CDBI class methods so that that when it's a class method
> it SUPER::method's, and when it's an object method it does the set
> specific operations? Is it better to generate a class per set? Would a
> interface with other method names be better or worse? (less conflicts 
> is
> also less consistent). Is there any way to get this right at all? Has
> anybody tried this before?
>
> See also http://www.thelackthereof.org/wiki.pl/SetDB
>
> -- 
>  ()  Yuval Kogman <nothingmuch@xxxxxxxx.xxx> 0xEBD27418  perl hacker &
>  /\  kung foo master: /me spreads pj3Ar using 0wnage: neeyah!!!!!!!!!!!
>

Class::DBI::Set
Yuval Kogman 18:08 on 25 Jun 2004

Re: Class::DBI::Set
steve shapero 08:19 on 28 Jun 2004

Re: Class::DBI::Set
Yuval Kogman 13:26 on 27 Jun 2004

Re: Class::DBI::Set
merlyn (Randal L. Schwartz) 14:23 on 28 Jun 2004

Re: Class::DBI::Set
Tony Bowden 10:10 on 28 Jun 2004

Re: Class::DBI::Set
"raptor 12:58 on 28 Jun 2004

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