stvn has asked for the wisdom of the Perl Monks concerning the following question:
I recently was looking at Test::MockObject as a means of faking a database in a test suite I am currently working on. But then it occured to me, what about a mock DBI driver. I looked around on CPAN, but could not find anything of the sort (at least not with the search terms I was using), I even poked around Google, but everything was coming up Java. So i decided I should give it a whirl myself. I have downloaded DBD::Template as well as DBD::FIle (the "default" driver supplied with DBI), and started digging through them. But before I go to far, I thought I would ask the monastary to see if I am re-inventing the wheel here already.
Has anyone either done this, or heard of someone doing this? Or ever tried to do this before and failed/gave up for whatever reason? Also I would invite comment on the idea itself, any thoughts on what it should be able to do, etc, etc. I am only really in the researching stage so far, so I am open to any ideas.
Update To Clarify
The idea is not so much to do tests on a file or memory based DB, but to be able to interact transparently with DBI and have the Driver be able to validate the tests in a way. In particular in cases of dynamically generated SQL, as opposed to straight DBI interaction.
Another Update
lachoy wrote DBD::Mock, which is exactly what I was looking for (pays to ask before you jump in I guess). I have been using it all day today with much success, I recommend it to other who might have similar needs. Excellent job lachoy!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Has anyone ever written DBD::MockDB
by jZed (Prior) on Apr 06, 2004 at 20:43 UTC | |
Re: Has anyone ever written DBD::MockDB
by dragonchild (Archbishop) on Apr 06, 2004 at 20:17 UTC | |
Re: Has anyone ever written DBD::MockDB
by lachoy (Parson) on Apr 07, 2004 at 00:48 UTC | |
by stvn (Monsignor) on Apr 07, 2004 at 01:26 UTC | |
Re: Has anyone ever written DBD::MockDB
by belg4mit (Prior) on Apr 06, 2004 at 20:29 UTC | |
Re: Has anyone ever written DBD::MockDB
by jfroebe (Parson) on Apr 06, 2004 at 21:07 UTC | |
Re: Has anyone ever written DBD::MockDB
by waswas-fng (Curate) on Apr 06, 2004 at 22:55 UTC | |
by stvn (Monsignor) on Apr 06, 2004 at 23:25 UTC |