Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: DBI like layer for database management?

by gregorovius (Friar)
on Apr 14, 2002 at 22:43 UTC ( [id://159033]=note: print w/replies, xml ) Need Help??


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

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.

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

Replies are listed 'Best First'.
Re: Re: Re: DBI like layer for database management?
by dws (Chancellor) on Apr 14, 2002 at 23:00 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://159033]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found