Jeff Zucker wrote:

Tim Bunce wrote:

Right, which brings us back to "making them subclass STORE".



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. So I will put STORE and FETCH into DBD::DBM. Does this apply to statement handles as well?

--
Jeff




Reply via email to