[Catalyst] merging DB data with XML data

Matt S Trout dbix-class at trout.me.uk
Fri Oct 5 19:05:19 GMT 2007


On Fri, Oct 05, 2007 at 10:52:19AM +0100, Carl Johnstone wrote:
> Hi,
> 
> This may be more of a DBIx::Class question than Catalyst, but anyway.
> 
> I have a system where the bulk of the content is generated elsewhere in XML 
> format, I've implemented a Catalyst Model that reads the XML, and returns a 
> blessed perl data structure (with appropriate caching etc.)
> 
> Where I've got problems is searching, it's impractical to search 1000s of 
> XML files, so I want to put some of the meta-information (and maybe dump a 
> copy of the text) into a DB for search purposes.
> 
> What I'd like to do though is when I do a search in the DB, turn any rows 
> returned into these XML objects so I can then access the whole of the 
> content as usual.

Replace or overload the inflate_result for the appropriate DBIC class - you
can turn the returned data into anything, getting back a DBIx::Class::Row
object is just what happens by default :)

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/



More information about the Catalyst mailing list