To clarify they are distinct mysql databases. One in particular is used
to establish relationships with 3 others that are of the same
characteristics.
To start with 2 db only, how can I configure the DBIC schema so the
relationship can be met, I have in DB.pm:
__PACKAGE__->config(
schema_class => 'MyApp::Schema',
connect_info => {
dsn => 'dbi:mysql:database=db1:host=host1',
user => 'root',
password => 'root'
},
);
Can I here add another connect_info to db2 from host2 or have dsn
referencing to an array of connections?
Thanks.
-----Original Message-----
From: Roland Philibert
Sent: 21 October 2011 15:52
To: '[email protected]'
Subject: multiple database connection
Hi all,
Could anybody send me an example on how to connect multiple databases
using DBIC::Schema?
I have:
package MyApp::Model::DB;
use strict;
use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__->config(
schema_class => 'MyApp::Schema',
connect_info => {
dsn => 'dbi:mysql:database=db1:host=host1',
user => 'root',
password => 'root',
}
);
And I need to connect to another mysql db (db2) under a different host
(host2)
Thank you all.
R.
---
Aptina (UK) Limited, Century Court, Millennium Way, Bracknell, Berkshire, RG12
2XT. Registered in England No. 06570543.
This e-mail and any attachments contain confidential information and are solely
for the review and use of the intended recipient. If you have received this
e-mail in error, please notify the sender and destroy this e-mail and any
copies.
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[email protected]