[Maypole] Accessing $dbh from within Maypole?

Dave Ranney dave@sialia.com
Mon, 1 Mar 2004 21:52:41 -0800


Jesse,

Here's one way to find it:

$dbh = FooDB->config->{classes}->[0]->db_Main();

Obviously, after you've called setup, any of your table-based model 
classes will have access to that method (but *not* your model base 
class). So you could simplify that to just FooDB::Tablename->db_Main(). 
But there's probably a more straightforward way. Anyone?

-Dave

On Mar 1, 2004, at 7:57 PM, Jesse Sheidlower wrote:

> If I need to access the $dbh directly from within Maypole, where
> do I find it? (Assuming an Apache::MVC base, of course.)
>

>    Handle => $dbh,     # <<<< what here?
>    LockHandle => $dbh  # <<<< likewise
>   };
> #...

------

Dave Ranney
Ladera Ranch, Orange County, CA
dave@sialia.com
CA Birding Lists Digest: http://www.sialia.com/s/calists.pl