[Dbix-class] Naming columns in nested joins

Jon dbix at bytabok.com
Wed May 24 15:00:25 CEST 2006


On 5/24/06, Matt S Trout <dbix-class at trout.me.uk> wrote:
[snip]

http://search.cpan.org/~jrobinson/DBIx-Class-0.06003/lib/DBIx/Class/ResultSet.pm#join
>
> "If the same join is supplied twice, it will be aliased to <rel>_2 (and
> similarly for a third time)."


Umm, ok. That's what you get for not RTFM :)


Basically, yes, you're supposed to keep track of it. Having a regular,
> simple rule for how relationships get aliased a second or third time
> means that you can always predict accurately what a given table in the
> query is going to be called, and means DBIC can always predirect it
> accurately as well. It takes a little bit of getting used to but once
> you have you'll find you don't have to think about it any more, and it
> ensures that DBIC can do all the magic it always does under the hood
> without trying to keep track of names its been given (which would be
> complex and potentially extremely fragile).



Makes sense. I just got a bit confused  since it was sort of unabstracting
away the sql (imho) but I see the stability problems.

/Jon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060524/d980142a/attachment.htm 


More information about the Dbix-class mailing list