On 18 Jun 2008, at 11:38, Ovid wrote:

Hi all,

Pursuant to an idea I've outlined in
http://use.perl.org/~Ovid/journal/36711, we're looking at caching some
of our test fixtures.  While some might *require* being generated
dynamically, many of our fixtures are in the following form:

 get bbc4 id
 create brand on bbc4
 create series3 on brand
 create episode2 on series3
 create 2 versions of episode2
 create episode3 on series3

And so on.  In short, these are large fixture files with very static
data being added to the database.  We feel that we can gain some
significant benefits if we can cache the above in something like this:

 -- md5:  ab523604f2f588df05389958560a042a

 INSERT INTO brand ...

 INSERT INTO series ...

And so on.  The idea is that on the first run of a fixture, we'd run
the code and cache the sql. On subsequent runs, if the md5 of the file
hasn't changed, we'd just send the cached SQL directly to MySQL rather
than run the code.

I think this would require intercepting the SQL and bind parameters and
every fixture would have a file we'd cache this in.  Has anyone tried
anything like this before?  How the heck would I get the SQL and bind
params for something like?

Or is there a much easier way of going about this?

Cheers,
Ovid

First thing I'd suggest is to look at DBIx::Class::Fixtures and see how close it comes to your needs. (I'm guessing you haven't looked at it yet judging by your useperl post)

-ash

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to