The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Apache::AxKit::Provider::RDBMS - Perl extension AxKit

SYNOPSIS

<Location /test.html> AxContentProvider Apache::AxKit::Provider::RDBMS AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT AxAddProcessor text/xsl test.xsl

    PerlSetVar DBIString "dbi:SQLite:dbname=/tmp/testsqllite"
    PerlSetVar DBIQuery "SELECT * FROM bla"
</Location>
                    

<Location /test2.html> AxContentProvider Apache::AxKit::Provider::RDBMS AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSL AxAddProcessor text/xsl test.xsl

    PerlSetVar RDBMSCacheAdapter "Apache::AxKit::Provider::RDBMS::DBCacheAdapter::SQLite"
    PerlSetVar RDBMSContentProvider "Apache::AxKit::Provider::RDBMS::ContentProvider::MultiSQL"
    PerlSetVar DBIString "dbi:SQLite:dbname=/tmp/testsqllite"
    
    PerlAddVar DBIQuery "query1 => SELECT * FROM bla"
    PerlAddVar DBIQuery "query2 => SELECT * FROM bla"
    PerlAddVar DBIQuery "query3 => SELECT * FROM bla"
</Location>
                                    

DESCRIPTION

Apache::AxKit::Provider::RDBMS is a custom axkit content provider which can be used to provide XML-Content to AxKit-Framework and even use its highlevel caching. The first release only support one Database namely SQLite but the module is designed to be easily extensible for other databases the only thing which has to be implemented is the DBCacheAdapter

Planned but not implemented for now: * Native Support for following databases (MySQL) => DbCachedAd * Generic Support using SQL-Statements for any SQL-Database

usage

To configure the various databases can/need to set the following variables using PerlSetVar and/or PerlAddVar.

RDBMSCacheAdapter:

the cache-adapeter used. If not set it defaults to "Apache::AxKit::Provider::RDBMS::DBCacheAdapter::SQLite"

RDBMSContentProvider:

the really database content provider used. If not set defaults to "Apache::AxKit::Provider::RDBMS::ContentProvider::SQL"

DBIString:

the connection string used to connect to the database consult your DBD::*-manpage to find out how it should look like for your database

DBIQuery:
PerlSetVar

You can use PerlSetVar in conjunction with A::A::P::RDBMS::ContentProvider::SQL to set the query executed

PerlAddVar

You can use PerlAddVar in conjunction with A::A::P::RDBMS::ContentProvider::MultiSQL to set multiple queries. The format passed in has to have the following look "queryname => SELECT .... "

The xml created by the provider

<!ELEMENT sql-results (sql-result+)>

<!ELEMENT sql-result ( row* )>

<!ATTLIST sql-result name CDATA>

<!ELEMENT row (column+) >

<!ELEMENT column (#PCDATA)>

<!ATTLIST column name CDATA>

SEE ALSO

AxKit (http://axkit.org)
DBD::SQLite
DBI
Apache::DBI

AUTHOR

Tom Schindl, <lt>tom.schindl@bestsolution.at<gt>

COPYRIGHT AND LICENSE

Copyright (C) 2005 by Tom Schindl

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.