On Sat, 7 Jun 2003, Claus F�rber wrote:
> Hallo,
>
> I think it would be a good idea to have a module named
> DateTime::Format::DBI that takes a DBI::db handle and returns an
> appropriate DateTime::Format::* object (currently, we only have ::MySQL
> and ::Pg).
>
> use DBI;
> use DateTime;
> use DateTime::Format::DBI;
>
> my $db = DBI->connect('dbi:...');
> my $db_parser = DateTime::Format::DBI->new($dbh);
> my $dt = DateTime->now();
>
> $db->do("UPDATE table SET dt=? WHERE foo='bar'",undef,
> $db_parser->format_datetime($dt);
>
> I already have an implementation; but I'd like to hear comments first
> instead of just releasing it.
That's a good idea. Of course, it won't be terribly useful until we have
more db-specific modules ;)
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/