Re: Not specifying 'Essential' columns means only Primary key is pulled on first select

[prev] [thread] [next] [Date index for 2004/11/17]

From: Cees Hek
Subject: Re: Not specifying 'Essential' columns means only Primary key is pulled on first select
Date: 12:04 on 17 Nov 2004
On Wed, 17 Nov 2004 11:08:00 +0000, Tony Bowden <tony-cdbitalk@xxxxx.xxx> wrote:
> On Wed, Nov 17, 2004 at 02:14:04PM +1100, Cees Hek wrote:
> > In the docs that it mentions that if you do not specifically name the
> > 'Essential' columns of the database, then the 'Essential' columns will
> > be set to 'All' columns.  This is what I expect to happen, but it is
> > not actually how it currently works in practice (in Class::DBI 0.96).
> 
> This is a doc bug rather than a code bug, and has been fixed in the
> latest version.

I have another question (or request) regarding this feature.  I won't
ask why this change was made, as I'm sure there was a good reason. 
However, I wonder if there is a clean way to specify that you want the
old behaviour?

I use set_up_table quite a lot, but would rather that it default to
setting all columns as Essential.  Would it be possible to add some
extra options to set_up_table that allowed this?

Perhaps the following?
__PACKAGE__->set_up_table('film', AllEssential => 1);

or maybe
__PACKAGE__->set_up_table('film');
__PACKAGE__->allEssential();

I guess the following would work now, but it is rather verbose
__PACKAGE__->columns(Essential => __PACKAGE__->columns('All'));

I'll take this up with the appropriate module authors if a concensis
is made that this is a good idea, or perhaps someone has another
solution.

Cheers,

        -- 
        Cees Hek

Re: Not specifying 'Essential' columns means only Primary key is pulled on first select
Cees Hek 12:04 on 17 Nov 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52