[Dbix-class] multiple database connection

Roland Philibert rphilibert at aptina.com
Fri Oct 21 14:52:19 GMT 2011


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.




More information about the DBIx-Class mailing list