[moved to dbi-dev]
On Sun, Mar 02, 2003 at 06:48:59AM -0500, Matthew O. Persico wrote:
>
> Does this make sense: Suggestion to all driver writers. Check our your APIs for
> the most likely candidates to be used in an 'install_method' call. Make the
> calls in a static init section for the driver. Document in the driver's POD.
Ah, now this raises an interesting issue.
The DBD::Foo::xx->install_method call won't work until the class-hierarchy
has been setup, and, for various reaons, that doesn't happen until after
the driver has been loaded and before DBD::Foo::dr->driver() gets called.
So just adding a bunch of DBD::Foo::xx->install_method calls into Foo.pm
won't work.
The best thing to do is add this line just before the
DBD::Foo::xx->install_method calls:
DBI::_setup_driver('DBD::Foo');
I'll add a better interface for that to the next release.
Probably something like:
DBI->setup_driver('DBD::Foo');
I may need to do some other tweaks as well, because currently the
setup_driver code just pushes things onto @ISA without checking
if they're already there.
Tim.
p.s. I don't want drivers to edit @ISA directly because one day I want to
be able to subclass drivers and layer them in interesting ways, maybe.