[Catalyst] More complex Class::DBI::Sweet usage?

Matt S Trout catalyst at trout.me.uk
Sat Jul 2 18:14:26 CEST 2005


On Fri, Jul 01, 2005 at 09:37:32PM -0400, Perrin Harkins wrote:
> On Sat, 2005-07-02 at 01:24 +0100, Matt S Trout wrote:
> > The 0.03 release of Class::DBI::Sweet can currently only auto-join by one
> > step (i.e. to tables related directly to the current one), so for the
> > moment I think you're correct[0].
> > 
> > If you were looking to connect across only 3 tables though, I'd say use
> > Sweet - with the ActiveRecord-:include-style prefetch facility it provides 
> > it's far less hassle than messing about with set_sql.
> > 
> > [0] I'm going to do arbitrary-step auto-joins as soon as I have time. Watch
> > This Space (and CPAN :)
> 
> You can use SQL::Abstract queries already.  Personally, I find them much
> harder than the equivalent SQL, but SQL::Abstract is handy when you want
> to build the query dynamically.

It's a matter of taste, I guess, but I find myself building complex dynamic
queries (usually at the request of a user) all the time, so I've got fairly
used to the way Abstract works. 
 
> If you're trying to get results that don't correspond to a single table,
> I would avoid Class::DBI for that part.

Base Class::DBI, yes. Class::DBI::Sweet, not always - and I'm planning to
do more to allow resultset-oriented things rather than record-oriented things
in Sweet later. I suspect Sweet will be much easier to build a decent view
layer on that Class::DBI itself is - but feel free to dis-believe me until
I show you the code :)

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.



More information about the Catalyst mailing list