[Catalyst] multiple database model support

Matt S Trout dbix-class at trout.me.uk
Sat Jul 19 23:55:15 BST 2008

On Tue, Jul 01, 2008 at 06:20:35AM +0530, jagdish eashwar wrote:
> I am working on two Catalyst applications and have set up different Mysql
> databases for each of them. Some of the tables that these two applications
> use are the same. At present, I am maintaining the common tables in both the
> databases. After reading this thread, I tried putting the common tables in a
> third database and creating two models in each of the Catalyst applications.
> I am, however, unable to set up  relationships between  tables across
> databases. Is this possible?

Yes, kind of.

If they're MySQL, then what I'd do is three sets of DBIC namespaces
and load the ones you need into each app.

DBIC can happily handle ->table('db1.table') under MySQL, and MySQL will
let you join between databases (the same way you'd use schemas in pg)

If you wantto discuss this further, I'd suggest taking it to the dbix-class

      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director                    http://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/            http://www.shadowcat.co.uk/servers/

More information about the Catalyst mailing list