Some months ago I contributed apr_dbd, giving us the framework for
SQL support within APR. The purpose of that was to generalise SQL
support within HTTPD, but I've neglected to add the httpd component!
Would people be interested to have mod_dbd relicensed and
within Apache 2.1?
About
-----
mod_dbd is a module to access apr_dbd from within HTTPD.
(1) It takes care of managing the database connections, using
apr_reslist to manage a pool of connections where APR_HAS_THREADS,
or a single persistent connection otherwise (also offers the option
to use one-off connections).
(2) mod_dbd is a utility for other modules, which it serves by
exporting three functions, best explained by a brief extract
from mod_dbd.h:
/* Export functions to access the database */
/* acquire a connection that MUST be explicitly closed.
* Returns NULL on error
*/
AP_DECLARE(dbd_t*) dbd_open(apr_pool_t*, server_rec*);
/* release a connection acquired with dbd_open */
AP_DECLARE(void) dbd_close(server_rec*, dbd_t*);
/* acquire a connection that will have the lifetime of a request
* and MUST NOT be explicitly closed. Return NULL on error.
* This is the preferred function for most applications.
*/
AP_DECLARE(dbd_t*) dbd_acquire(request_rec*);
/* Also export them as optional functions for modules that prefer it */
APR_DECLARE_OPTIONAL_FN(dbd_t*, dbd_open, (apr_pool_t*, server_rec*));
APR_DECLARE_OPTIONAL_FN(void, dbd_close, (server_rec*, dbd_t*));
APR_DECLARE_OPTIONAL_FN(dbd_t*, dbd_acquire, (request_rec*));
(3) It allows us to define prepared SQL statements in httpd.conf -
for modules like authentication or logging.
For the full story:
http://www.apache.org/~niq/dbd.html
--
Nick Kew