[Catalyst] How do you structure multi-table DBIx queries?

Matt S Trout dbix-class at trout.me.uk
Tue Jul 25 15:38:19 CEST 2006


Dennis Daupert wrote:
>  > You can see usage examples in DBIx::Class::Manual::Cookbok
> 
> Nilson, thanks for the reply. Yes, I've combed thru that, printed out, 
> combed some more; that, and several others.
> 
>  > If you don't know how to define your relationships, you should take a
>  > look at DBIx::Class::Manual::Intro and other related docs.
> 
> I've also read thru the Intro, and worked thru various tutorials,
> including the latest series (this one sets up some basic has_many,
> many_to_many, and belongs_to):
> 
> http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7001/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod
> 
> Admittedly, I AM NOT A DBA ;-) I consider myself a DBN (database noobie)
> But I do know my setup is at least workable. I have several sets of
> working hand-rolled CRUD pages. I'm just having a bit of trouble translating
> the join and prefetch examples in, for example, the 
> DBIx::Class::Manual::Cookbook
> to my multi-table, multi-join, column subset query.

If you're a noob, then I'd recommend not worrying about the column subset 
part; the efficiency difference is unlikely to be massive so long as you do 
the entire fetch in a single query, which correct use of the 'prefetch' 
attribute will do for you (as outlined in my first reply).

-- 
      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 Catalyst mailing list