On Fri, Mar 22, 2002 at 08:24:11AM -0800, Jeff Zucker wrote:
> Tim Bunce wrote:
> >
> > I'd appreciate it if anyone who may be interested in a pure-perl
> > DBI emulation could explain why. Just so I can get some idea of the
> > real-world issues that a pure-perl DBI emulation might address.
>
> Precisely the question that has kept me from releasing this. OTOH it's
> pretty convenient to email a self-contained demo of a database app to
> someone which they can simply unpack and run.
>
> > I'd also like to know if those real-world issues could be
> > better addressed by bundling the DBI with perl, so if you have perl
> > installed anywhere then you'll also have the DBI installed there.
>
> You mean DBI as part of the standard core distribution? I can't see how
> that could be a bad thing. In that case the emulation would only be
> useful (if at all) to people with older perls.
>
> Tim, I'm emailing you a working copy this morning (west coast usa time
> :-).
>
> Tony and Nick, I'd prefer not to have this even floating around until I
> hear more from Tim.
And it's not good I'm afraid. You've effectively hardwired a specific
driver in place of the DBI. It only emulates the DBI in the narrowest
sense. You can't use it to load and run any random pure-perl driver.
And that's a pity because there's (probably) no big technical issues
in creating a true pure-perl DBI with a reasonable level of functionality
(but much slower performance).
I'd expect it to be hooked into the real DBI.pm something like this:
eval {
bootstrap DBI;
};
if ($@) {
my $error = $@;
die $error unless $error =~ /.../ # DBI.xs not available
die $error unless eval { require DBI::PurePerl; }
}
DBI::PurePerl would start with 'package DBI;' and define all
the functions and methods that DBI.xs currently does.
Tim.