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

Michael G Schwern schwern at pobox.com
Sat Mar 21 02:48:05 GMT 2009


Perrin Harkins wrote:
> 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.

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.



More information about the ClassDBI mailing list