Tim Bunce wrote: > > On Fri, Feb 01, 2002 at 10:46:12AM -0800, Jeff Zucker wrote: > > > > So is this the way to do get_info() for DBD::CSV and DBD::AnyData? > > Well it's certainly one way. > > > sub get_info { > > my($dbh, $info_type) = @_; > > my $v; > > if ($SQL::Statement::VERSION > 1) { > > require DBD::SQL_Statement::GetInfo; > > $v = $DBD::SQL_Statement::GetInfo::info{int($info_type)}; > > } > > else { > > ... > > There's probably cleaner ways of doing it. > > The drivers could certainly try looking up $info_type in whichever > SQL::Statement they're using (giving it 'first refusal' to answer > any requests). SQL::Statement would only define values that are > appropriate to it. > > If the lookup in SQL::Statement doesn't return a defined value the > lookup the $info_type in the drivers own hash.
I'm not sure I can think of anything that would go in "the driver's own hash". It seems to me that in this case everything would be either in the $dbh or in SQL::Statement's configuration. If the $dbh values are returned as SQL::Statement::GetInfo::info coderefs, then I can keep all of the GetInfo stuff there rather than having to duplicate it in each DBD that subclasses SQL::Statement. > I do plan to define a minimum set of values that drivers will be > expected to support. I'm looking forward to seeing that :-) -- Jeff