Hi,
For MySQL e.g. it would not be more than:
-------------------------8<------------------------- package Apache::AxKit::Provider::RDBMS::DbCacheAdapter::MySQL;
use base qw( Apache::AxKit::Provider::RDBMS::DbCacheAdapter );
use DBI; use Time::Piece; use strict;
sub mtime {
my $this = shift;
my $tableName = $this->{apache}->dir_config("DBIQueryTable"); my $dbh = DBI->connect("DBI:mysql:database=blimer","root",""); my $sth = $dbh->prepare('SHOW TABLE STATUS LIKE "'.$tableName.'";');
$sth->execute(); my $rows = $sth->fetchall_arrayref( { Update_time => 1 } );
my $row;
my $t;
my $time = 0;
my $tmp; foreach $row ( @{ $rows } ) {
foreach( keys %{ $row } ) {
$t=Time::Piece->strptime($row->{$_},'%Y-%m-%d %H:%M:%S')->epoch();
$time = $t if( $time < $t )
}
}return $time; } -------------------------8<-------------------------
You could tell the equivalent for PostgreSQL I put on my TODO-List and add it the next time.
Tom
Marco Marongiu wrote:
Tom Schindl wrote:
sometime ago I promised in a thread that I will upload a Provider which lets you fetch content from a database not using XSP which has the draw-back that AxKit cannot cache the transform results.
The whole provider is at a very early stage and does not support many databases (at the moment only SQLLite is supported and is not thoroughly tested) but I decide to present it to the public to see if people like it.
Great idea, Tom!
I would like to see a PostgreSQL version around but I don't know if I would be able to extend your provider... no experience on Providers and not a real programmer, it seems. :-( Moreover, I am not working on AxKit things since many weeks today, I have been given other priorities at work.
Anyway, thanks for creating AAPRDMBS!
Ciao --bronto
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
