apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject New DBD drivers
Date Tue, 04 Sep 2007 13:12:01 GMT
I've just committed two new DBD drivers:
  * apr_dbd_mysql
  * apr_dbd_freetds

apr_dbd_mysql is the familiar MySQL driver.  Following the
recent thread on the subject[1], I've gone ahead and
relicensed it, and dropped it in to our SVN.

apr_dbd_freetds is a driver using FreeTDS[2] to access a
MSSQL or Sybase database.  It was developed and tested
with a MSSQL backend, and has not been tested with Sybase.
On advice from someone on the FreeTDS developer list,
I used db-lib API, which is one of three provided by
FreeTDS.  I don't claim to understand the implications
of this choice, and presumably other drivers could use
the other FreeTDS APIs.

It is only a partial implementation in several ways:
  * Returning random-access results from SELECT doesn't work.
  * Only the 1.2 DBD API is implemented.  Stubs are provided
    for the extensions in trunk/1.3.
  * The db-lib API used doesn't support prepared statements,
    so the driver emulates them.
  * Only string variables (%s) are supported in prepared
    statements.

A consequence of not supporting prepared statements is that
security becomes an issue, and I've adopted Perl-like taint
checking to deal with it.  This is something we might consider
moving to the apr_dbd level for use by other drivers.

Maintaining the FreeTDS driver may be an issue unless and
until a windows-based development environment materialises.
But publishing it may help us get input from the FreeTDS folks.

[1] http://marc.info/?t=118582567400005&r=1&w=2
[2] http://www.freetds.org/

-- 
Nick Kew

Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/

Mime
View raw message