[Catalyst] instantiating persistent DBHs: MyApp.pm? Model?

Matt S Trout dbix-class at trout.me.uk
Mon Jun 25 19:46:08 GMT 2007


On Sun, Jun 24, 2007 at 05:17:32PM -0600, Todd Harris wrote:
> Hi Matt -
> 
> Thanks for the tip!  Yep, this makes sense and works well.
> 
> I'm still relying on my old code for an oo database with no driver.   
> I'm looking to interface more directly with DBIC if possible in the  
> future, but for now, things are working as expected.

Bear in mind you can (a) get the $dbh out of a DBIC model, (b) pass a subref
to a DBIC model to return a $dbh from elsewhere (this works in plain DBIC as
well but I figure you care more about the cat case). Between the two it's
pretty much always possible to mix and match DBIC and legacy/specialised
stuff and still have a single DB connection.

But hell, if it works for now, sorted :D

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list