[Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC - bug?)

2010-01-17 Thread Thomas L. Shinnick
Trying again to forward to DBIC list, which rejected my previous try at forwarding with additions... From: "Octavian Rasnita" To: "The elegant MVC web framework" Date: Sun, 17 Jan 2010 15:22:57 +0200 Subject: [Catalyst] Selecting from more tables (DBIC - bug?) Hi, Sorry for not writing to t

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC - bug?)

2010-01-19 Thread Ronald J Kimball
Thomas L. Shinnick wrote: I'm having some of the same questions regarding +select and +as . It seems that using '+select' and '+as' does not stop other columns from being returned. I'm using DBIC 0.08115. What do you expect +select and +as to do?? +select Indicates additional columns t

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC- bug?)

2010-01-19 Thread Octavian Rasnita
From: "Ronald J Kimball" Thomas L. Shinnick wrote: I'm having some of the same questions regarding +select and +as . It seems that using '+select' and '+as' does not stop other columns from being returned. I'm using DBIC 0.08115. What do you expect +select and +as to do?? +select Ind

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC- bug?)

2010-01-19 Thread iain
my $uuu = $schema->resultset('User')->search({},{ prefetch => {blogs => 'blog_comments'}, select => ['me.id'], as => ['user_id'], }); print $uuu->first->username; I think the single column that should be printed should be me.id, but here is the generated SQL: SELECT me.id, blogs.id, blogs.u

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC-bug?)

2010-01-19 Thread Octavian Rasnita
From: "iain" my $uuu = $schema->resultset('User')->search({},{ prefetch => {blogs => 'blog_comments'}, select => ['me.id'], as => ['user_id'], }); print $uuu->first->username; I think the single column that should be printed should be me.id, but here is the generated SQL: SELECT me.id, b

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables(DBIC-bug?)

2010-01-20 Thread Carl Johnstone
Octavian Rasnita wrote: > my $uuu = $schema->resultset('User')->search({},{ > prefetch => {blogs => 'blog_comments'}, > select => ['me.id'], > as => ['user_id'], > }); > > print $uuu->first->username; > > I know, but I would like to prefetch only just a few columns from the > joined tables, not all

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables (DBIC-bug?)

2010-01-20 Thread Peter Rabbitson
Octavian Rasnita wrote: > From: "iain" > >> >>> my $uuu = $schema->resultset('User')->search({},{ >>> prefetch => {blogs => 'blog_comments'}, >>> select => ['me.id'], >>> as => ['user_id'], >>> }); >>> >>> print $uuu->first->username; >>> >>> I think the single column that should be printed shoul

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables(DBIC-bug?)

2010-01-20 Thread Octavian Rasnita
From: "Carl Johnstone" Octavian Rasnita wrote: my $uuu = $schema->resultset('User')->search({},{ prefetch => {blogs => 'blog_comments'}, select => ['me.id'], as => ['user_id'], }); print $uuu->first->username; I know, but I would like to prefetch only just a few columns from the joined tables

Re: [Dbix-class] Fwd: [Catalyst] Selecting from more tables(DBIC-bug?)

2010-01-20 Thread Carl Johnstone
Octavian Rasnita wrote: > So is it not possible to create the following query with DBIC? > > SELECT me.id, blogs.id, blog_comments.id > FROM user me LEFT JOIN blog blogs ON blogs.user = me.id > LEFT JOIN blog_comment blog_comments ON blog_comments.blog = blogs.id; Yes, but if you want to spend you