[Catalyst] CDBI::Sweet wishlist

Will Hawes info at whawes.co.uk
Fri Jul 8 14:00:30 CEST 2005


Not sure if it's been released yet, but the most recent version of Sweet (see Catalyst SVN) does something similar to what you describe.

wh

----- Original Message -----
From: James Tolley <james at bitperfect.com>
To: The elegant MVC web framework <catalyst at lists.rawmode.org>
Sent: Fri,  8 Jul 2005 11:42:44 +0100
Subject: [Catalyst] CDBI::Sweet wishlist


> > If there's anything you would like to be able to do with cdbi/sweet but
> > currently can't I'd be extremely interested in use cases and for
> preference
> > samples of "it would be nice if I can write this code and have it work".
> 
> You asked for it! :-) This is similar to my understanding of what
> Rob::Database (posted recently) does:
> 
> I'd like to be able to provide a minimal query, and have all of the joins
> happen automatically, based upon the relationships defined through CDBI.
> Based upon the CDBI perldoc examples:
> 
> my @artists = MyApp::Artist->select({
>   year => '2001',  # unambiguous fieldname
>   style => 'Blues', # arbitrary number of joins (artist -> cd ->
> style_ref -> style)
> },     { order_by => 'artistid DESC' });
> 
> The style field might be a little over the top, since there are two style
> fields in the db: style_ref.style and style.style, but you get the idea...
> of course, we _could_ say that the arg to style ('Blues') isn't numeric, so
> it must be referring to style.style, which holds chars...?
> 
> Of course, the icing on the cake would be if then:
> 
> my @cds = $artists[0]->cds; # only matching cds returned.
> 
> But I can't quite work out whether or not that would mean that only certain
> styles would be returned from $cd->styles. That wouldn't be DWIMmish...
> 
> James
> 
> 
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
> 
> 




More information about the Catalyst mailing list