On Thu, Oct 16, 2003 at 02:12:36PM -0700, Dean Arnold wrote:
> Has anyone attempted to write a DBD
> using Inline::C (or C++) ? I'm looking into updating a driver
> to selectively switch between a pure Perl implementation,
> and a native C i/f to a low level vendor API library if its available, in order
> to get more performance/functionality. Inline::C looked 
> like an attractive alternative (esp w/ Inline::Struct) to all the XS 
> madness. This would allow the driver to exploit Perl's 
> strenghts for parsing SQL, mapping things w/ hashes, etc, but
> use the vendor lib for the low level data movement, as opposed
> to writing a complete DBD in C/XS.

I don't think any DBD is pure C/XS. All have a significant amount of perl.

Driver authors wanting to use C don't have to write _any_ XS if they
use the Driver.xst template mechanism (which is strongly recommended).

Then just add some logic around the "bootstrap()" method call in
the .pm file. The .pm file can implement the same methods as the
C/XS code and, if the c/XS code hasn't been bootstraped, then the
perl methods will be called instead. Simple.

Tim.

Reply via email to