in reply to DBI like layer for database management?

I'm looking for a database independent module for doing database management functions. At a minimum such module would support ..., just like DBI does.

How about... DBI?

If DBI isn't satisfactory, tell us why not. That might help us make suggestions.

If you're looking for something that assists with backup and restore, you're going outside of the normal SQL-centric client interface that RDMBSs provide. Backup/restore are typically performed using separate administrative interfaces. It's doubtful that you'll find something portable that doesn't cost $$$.

  • Comment on Re: DBI like layer for database management?

Replies are listed 'Best First'.
Re: Re: DBI like layer for database management?
by gregorovius (Friar) on Apr 14, 2002 at 22:43 UTC
    If DBI isn't satisfactory, tell us why not. That might help us make suggestions.

    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. Tests in this suite are machine generated by way of a "snooping" proxy that records every request going to the server from a live user exercising the application. Tests work as dumb automata that simply replay the recorded sequences.

    For these sequences to run as expected, the database must be reset to the the same state in which they were recorded.

    Currently I only support MySQL and I do backup and restoring by directly invoking the mysql command line tool from my script.

    I would prefer to do backup and restoring in a less ad-hoc way, and I would also like to support other RDBMS as well. I don't think one can do this through DBI but it would be a nice if it was possible.

      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