[Dbix-class] Result->id
Vladimir Melnik
v.melnik at uplink.ua
Tue Nov 28 09:56:11 GMT 2017
Dear colleagues,
Is `id()` should return a content of the `id` column if it presents, even if we have a multi-column PK (so it's supposed to return a list of PK values as it described in the `DBIx::Class::Row` manual)?
So, I have a table whose PKs are `id` and `known_from`, I have the following in the Result-based class definition:
__PACKAGE__->set_primary_key("id", "known_from");
But it always return one number - the content of the `id` column.
What overrides what: an internal method and a column-name-based method? If the column-name-based one has higher priority, should I consider renaming the `id` field to some crappy `_id`? Or would it be a better way to call it as '_id' when I'm doing `__PACKAGE__->add_columns("id", ...)`? If yes, would it be possible to ask `DBIx::Class::Schema::Loader` to do that each time?
Thanks in advance for your time, dear colleagues.
If anyone have experince with multi-column PK with DBIx::Class and with temporal (also as bi-temporal and multi-temporal) - please share your wisdom.
--
V.Melnik
More information about the DBIx-Class
mailing list