Re: [CDBI] Having a column named 'id' as part of a multi-column primary key

[prev] [thread] [next] [Date index for 2005/08/11]

From: Kingsley Kerce
Subject: Re: [CDBI] Having a column named 'id' as part of a multi-column primary key
Date: 16:36 on 11 Aug 2005
Randal L. Schwartz writes:
 > >>>>> "Scotty" == Scotty Allen <lists@xxxxxxxxxxx.xxx> writes:
 > 
 > Scotty> However, this all raises a separate question: what do you do
 > Scotty> when you're retrofitting cdbi on top of an existing schema,
 > Scotty> that may have namespace collisions between columns and cdbi
 > Scotty> reserved names?  Is there a way to remap a column to a
 > Scotty> different accessor name?  Or another trick I don't know of?
 > 
 > Will the strategy under "Changing your column accessor method names"
 > on the manpage suffice?

Here is a particular example.  I have the following method in a
table's CDBI class; the table has a composite key containing "id".

sub accessor_name {
  my ($self,$column) = @_;
  return "myid" if $column eq "id";
  return $column;
}

Kings


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

Re: [CDBI] Having a column named 'id' as part of a multi-column primary key
Kingsley Kerce 16:36 on 11 Aug 2005

Generated at 13:17 on 19 Aug 2005 by mariachi v0.52