http://www.perlmonks.org?node_id=263779


in reply to Re: Class::DBI and DB design
in thread Class::DBI and DB design

Let me see if I understand this correctly. If I have a table like user_capabilities in my original question, could I use something like this?

package My::UserCapabilities; use base 'My::ClassDBI'; __PACKAGE__->table ("user_capabilities"); __PACKAGE__->columns (All => (""));

And then define methods for each of the columns myself? i.e., does defining methods myself provide a way around the single primary key restriction, or did you just mention it as a way of providing extra functionality later?

Now that I think about it, maybe what you're suggesting is that I not define a class for the non-primary-key tables, and just provide a hand-coded method in a different class (e.g., "My::User") to get to that information. Is that what you meant?