CRUDdy DBIC question

Chris Jack chris_jack at msn.com
Mon Jan 23 17:41:10 GMT 2012


Bob MacCallum uncoolbob at gmail.com wrote:
> Sorry about the Perl question.
> 
> We have a database model where the master copy of the data is file based.
> 
> Is there some DBIx::Class magic which does some kind of nested
> update_or_create_or_delete? For example, an object might initially be
> written to the db along with its three children, but then someone
> edits the file and removes one child, adds another, and edits an
> existing child.
> 
> I've seen http://search.cpan.org/~scain/DBIx-DBStag-0.12/DBIx/DBStag.pm
> and stag-storenode.pl - if we convert our files into Stag format
> temporarily, maybe this could work. Are there any other options I've
> missed?
> 
> many thanks,
> Bob.

You could use something like DBM and there's a section in the Perl Cookbook on using tie with objects but...
 
I really question the desirability of doing something like this with anything that doesn't pass the ACID test. There are so many advantages to using a relational database (mySQL is free), I'm wondering why you're not going down that route.
 
How much data are we talking about?
Do you care about maintaining your data if your program terminates abnormally?
Do you need more than one program to access it at a time?
 
Regards
Chris 		 	   		  


More information about the london.pm mailing list