[Dbix-class] convention for naming primary
orasnita at gmail.com
Tue Nov 25 23:27:00 GMT 2008
From: "Peter Rabbitson" <rabbit+list at rabbit.us>
>> I think that if the query needs to search in a table named "me" which is
>> not the primary table, it probably gives another name instead of "me"
>> for the main table, so that name shouldn't need to be hard coded in the
>> By the way, does anyone know what happends if a secondary table is named
> The name of the table is irrelevant as they are all aliased anyway. If
> you have a relationship called 'me' (hence JOIN <tblname> me), then I
> believe DBIC will switch it to me2 (just like it does with stacked joins
> over the same relationship). If not - it might very well be a bug,
> tests/patches welcome :)
Ok, I understand. So the main table will be named "me" and the "me" table
will be named "me2".
But I still don't see yet why it wouldn't be possible to prepend the prefix
"me." to all the columns from the where conditions if those columns don't
have any kind of prefix.
More information about the DBIx-Class