Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 104289
Status: open
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: kes-kes [...] yandex.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: unclear documentation
In example you show: # OR (same result) My::DBIC::Schema::Book->belongs_to( author => 'My::DBIC::Schema::Author', { 'foreign.author_id' => 'self.author_id' } ); But tables Authors and Books has no author_id field. Authors: ID | Name | Age ------------------ 1 | Fred | 30 2 | Joe | 32 and a table Books: ID | Author | Name -------------------- 1 | 1 | Rulers of the universe 2 | 1 | Rulers of the galaxy So it is unclear what is coming on and how to use...
On Thu May 07 08:25:12 2015, kes-kes@yandex.ru wrote: Show quoted text
> In example you show: > > # OR (same result) > My::DBIC::Schema::Book->belongs_to( > author => > 'My::DBIC::Schema::Author', > { 'foreign.author_id' => 'self.author_id' } > ); >
Can you please point out where this example is...? Show quoted text
> But tables Authors and Books has no author_id field. >
Where did you see these tables...? There is nothing like this in https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082820/examples/Schema
Crap I see now... I've never even seen this part of the docs before. Thanks for pointing this out.
From: kes-kes [...] yandex.ru
The another problem with DOC. As you has noted at: https://rt.cpan.org/Public/Bug/Display.html?id=104300#txn-1494690 The doc says nothing about: https://rt.cpan.org/Public/Bug/Display.html?id=104300#txn-1494497 Also there are more cross links to each other. "More info there [link]" and as result no any info. Also there is no info when I must use 'search', when 'search_related', when 'join' option in attributes. Nothing about that 'search_related' ignores 'join_type' attribute There are NO examples how to construct 'RIGHT JOIN'. (can I ask you, please give me example here about RIGHT JOIN. I need it very much)
Subject: Re: [rt.cpan.org #104289] DBIC::Relationship docs are inconsistent wrt example given at top of document
Date: Fri, 08 May 2015 16:48:29 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 05/08/2015 04:46 PM, Eugen Konkov via RT wrote: Show quoted text
> Queue: DBIx-Class > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104289 > > > The another problem with DOC. > > As you has noted at: https://rt.cpan.org/Public/Bug/Display.html?id=104300#txn-1494690 > > The doc says nothing about: > https://rt.cpan.org/Public/Bug/Display.html?id=104300#txn-1494497 > > Also there are more cross links to each other. "More info there [link]" and as result no any info. > > Also there is no info when I must use 'search', when 'search_related', when 'join' option in attributes. > > Nothing about that 'search_related' ignores 'join_type' attribute > > There are NO examples how to construct 'RIGHT JOIN'. > > (can I ask you, please give me example here about RIGHT JOIN. I need it very much)
Right joins make no sense within DBIx::Class, as there are no "objects on the left" to hang some of the results to. The relationship traversal only goes "left". Nevertheless these are all valid complaints, that needs addressing in some form...
From: kes-kes [...] yandex.ru
How about? $rs2 = $rs->search( ... , { join => 'lefttablename' ); $rs3 = $rs2->search( ..., { rjoin => 'righttablename' } ); print $rs3->as_query; SELECT * FROM ... LEFT JOIN lefttablename ON ... RIGHT JOIN righttablename ON ... In ::Relation::RightTableName.pm we have: righttablename->belongs_to/has_one/many_to_many( lefttablename, ... so if we use 'rjoin' as option we explicitly ask to generate RIGHT JOIN if we use 'ljoin' as option we explicitly ask to generate LEFT JOIN if we use 'join' as option we rely on 'join_type' attribute or default behaviour of 'has_many', 'belongs_to' etc.
From: kes-kes [...] yandex.ru
May I post other notices on DOC here or open new bug report? There is no descriptions and examples that these are same: my $query1 = $self->search_related( 'servers' ) my $query3 = $self->servers
Subject: Re: [rt.cpan.org #104289] DBIC::Relationship docs are inconsistent wrt example given at top of document
Date: Fri, 08 May 2015 18:41:40 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 05/08/2015 05:43 PM, Eugen Konkov via RT wrote: Show quoted text
> Queue: DBIx-Class > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=104289 > > > How about? > > $rs2 = $rs->search( ... , { join => 'lefttablename' ); > $rs3 = $rs2->search( ..., { rjoin => 'righttablename' } ); > > print $rs3->as_query; > > SELECT * FROM ... > LEFT JOIN lefttablename ON ... > RIGHT JOIN righttablename ON ... > > In ::Relation::RightTableName.pm we have: > > righttablename->belongs_to/has_one/many_to_many( lefttablename, ... > > > so if we use 'rjoin' as option we explicitly ask to generate RIGHT JOIN > if we use 'ljoin' as option we explicitly ask to generate LEFT JOIN > if we use 'join' as option we rely on 'join_type' attribute or default behaviour of 'has_many', 'belongs_to' etc.
You misunderstood me. The *RESULT* of a right join is useless, because there is nothing the DBIC result parser could attach it to. You are fundamentally misunderstanding what the 'join' attribute does in the first place. Please join the IRC channel and poke someone for a more interactive explanation (refer to this RT)