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

Perrin Harkins pharkins at gmail.com
Fri Mar 20 23:40:38 GMT 2009

On Fri, Mar 20, 2009 at 6:44 PM, Jeff Pelkey <pelkey.jeff at gmail.com> 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.

- Perrin

More information about the ClassDBI mailing list