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
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
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
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
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
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
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
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
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