[CDBI] Sharing Queries with set_sql

Matt S Trout dbix-class at trout.me.uk
Tue Sep 6 16:45:57 BST 2005

On Tue, Sep 06, 2005 at 04:21:15PM +0100, William Ross wrote:
> If it's about returning values from more than one table and  
> generating reports from within cdbi classes, the usual answer is  
> 'don't: it's not the right tool'. Do it at the template level, and if  
> that's too inefficient then write a custom reporting class: cdbi  
> becomes slippery and awkward if you don't stick to the simple  
> correspondences it expects.

And if you're worried about the query overhead, use Class::DBI::Sweet's
prefetch feature to do a JOINed SELECT that populates has_a and might_have
relations from a single query.

     Matt S Trout       Specialists in perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

More information about the ClassDBI mailing list