On Thu, Mar 04, 2004 at 09:46:56AM -0800, Jeff Zucker wrote:
> Jeff Zucker wrote:
> >Tim Bunce wrote:
> >
> >But why not just let the DBD::File subclasser define an f_valid_attrs
> >hash and let DBD::File do it like this (only for lower-cased attribute
> >names)
> >
> > my $prefix = $dbh->{f_valid_attrs}->{_prefix};
> > if ( $prefix
> > and !$dbh->{f_valid_attrs}->{$attrib}
> > and $attrib =~ /^(f_|sql_|$prefix)/
> > ) {
> > return $dbh->set_err( 1,"Invalid attribute '$attrib'!");
> > }
> >
> >Has the same effect as what you proposed, but no STORE or FETCH in the
> >subclassed driver.
> >
> ... the other shoe drops. My suggestion above is probably bad because
> the driver may need to check the *value* as well as the attribute so it
> should happen in the driver, not in DBD::File.
Not just "check the value" but also possibly so something other than
just simply store the value. Similarly for FETCH, some values may need
to be created dynamically.
> So I will put STORE and
> FETCH into DBD::DBM. Does this apply to statement handles as well?
Yeap.
Tim.