Re: [Dbix-class] select specific columns on resultset

2013-04-10 Thread max
Ok, sorry, I copied the wrong example, I tried with: my @recs=$self->db->resultset($self->table)->search({},{columns => [qw/ id /],},)->all; but I can see the Name column for example in the foreach loop. After some debugging on mysql I found some stranges: 67 Query SELECT me.id FROM ReportTe

[Dbix-class] Complex joins

2013-04-10 Thread Iain C Docherty
I have googled for this, as far as I can tell DBIx::Class does not support complex joins. An example of which is below. select star.id,star.name,body.id,body.name,building.class,empire.name from star LEFT JOIN probes ON star.id = probes.star_id AND probes.alliance_id=26 LEFT JOIN body ON sta

Re: [Dbix-class] Complex joins

2013-04-10 Thread Matthew Phillips
Hi Lain, What you are looking for is the coderef syntax for declaring a relationship as describe here: https://metacpan.org/module/DBIx::Class::Relationship::Base#condition Cheers, Matt On Wed, Apr 10, 2013 at 3:40 PM, Iain C Docherty < dbix-cl...@iain-docherty.com> wrote: > I have googled for

Re: [Dbix-class] Complex joins

2013-04-10 Thread Iain C Docherty
Brilliant! That is indeed the answer I was (blindly) looking for. Thanks greatly. Iain. On 10 April 2013 20:46, Matthew Phillips wrote: > Hi Lain, > What you are looking for is the coderef syntax for declaring a > relationship as describe here: > https://metacpan.org/module/DBIx::Class::Relat