[CDBI] Retrieving Columns Other then Essentials

Scott Kahler scott.kahler at gmail.com
Fri Mar 17 17:16:35 GMT 2006


Class DBI new user here.  I'm trying to follow this example from the man
page:

snip
       You should therefore group together your columns by typical usage, as
fetching one value from a group can also pre-fetch all the others in that
       group for you, for more efficient access.

       So for example, if we usually fetch the artist and title, but don't
use the 'year' so much, then we could say the following:

         Music::CD->columns(Primary   => qw/cdid/);
         Music::CD->columns(Essential => qw/artist title/);
         Music::CD->columns(Others    => qw/year runlength/);

       Now when you fetch back a CD it will come pre-loaded with the 'cdid',
'artist' and 'title' fields. Fetching the 'year' will mean another visit to
       the database, but will bring back the 'runlength' whilst it's there.

       This can potentially increase performance.
snip

My question is how exactly do I fetch the year after I've made a call such
as

my $cd_obj =Music::CD->retrieve(1);

I'm probably missing something very obvious but I can't seem to find it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digitalcraftsmen.net/mailman/private/classdbi/attachments/20060317/5574e4a6/attachment.htm


More information about the ClassDBI mailing list