[CDBI] Preloading objects when using a view

Matt S Trout dbix-class at trout.me.uk
Wed Mar 29 14:56:17 BST 2006


Juan Camacho wrote:
> On 3/28/06, Bill Moseley <moseley at hank.org> wrote:
>> It would be nice to do something like:
>>
>>     __PACKAGE__->has_a( artist_name => ['Music::Artist', 'name' ] );
>>
> 
> Nothing much I can contribute here :) I simply wanted to say that it
> would also be nice that the implementation include an option for a
> LEFT JOIN.  In that way, you are guaranteed to have the CD data and it
> would be closer to the results you get from doing two calls to the db.

If it's a FOREIGN KEY then you almost certainly want a straight join, not a 
LEFT one. Doing LEFT JOIN is more important for fetching associated might_have 
and has_many relationships without missing main table records (been through 
the fun of this one already for DBIx::Class which can now happily fetch both),

-- 
      Matt S Trout       Offering custom development, consultancy and support
   Technical Director    contracts for Catalyst, DBIx::Class and BAST. Contact
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