Re: [CDBI] Using One Class to connect to multiple instances and more.

Michael G Schwern <[email protected]> Fri, 20 Mar 2009 19:48:05 -0700
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Perrin Harkins wrote:
> On Fri, Mar 20, 2009 at 6:44 PM, Jeff Pelkey <[email protected]> wrote:
>> My question is this:  What is the best way to create one base to
>> connect to all the instances and one regular class for each table.
>> Then I just pass the region_id to the base class and have it connect
>> to that instance.  Plus access all the tables using a variable that
>> identifies each stores and connect to each table using that method?
> 
> There are examples of dynamically switching between schemas on the
> wiki.  Switching tables on the fly might be harder.  I'm not sure off
> the top of my head what's being done at compile time.  But check the
> wiki first and see what the examples there do for you.

The wiki being here.
http://wiki.class-dbi.com/wiki/Main_Page

And the article on multiple databases here:
http://wiki.class-dbi.com/wiki/Using_multiple_databases


-- 
I have a date with some giant cartoon robots and booze.