in reply to Re: Re: DBI like layer for database management?
in thread DBI like layer for database management?

What I need this for is a testing framework for web apps that requires a fresh copy of a "known state" database to be restored before each test in a test suite runs. ... Currently I only support MySQL and I do backup and restoring by directly invoking the mysql command line tool from my script.

One way of doing this is to keep reference copies of your test data in one set of tables (say, in a parallel "reference" database), then refresh target tables by doing

DELETE FROM foo; INSERT INTO foo SELECT * FROM reference.foo;
This should be easily scriptable through DBI. See here for documentation on MySQL's INSERT ... SELECT