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

Perrin Harkins <[email protected]> Fri, 20 Mar 2009 19:40:38 -0400
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
On Fri, Mar 20, 2009 at 6:44 PM, Jeff Pelkey <[email protected]> wrote:
> My question is this:=A0 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. =A0Plus 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.

- Perrin