[Catalyst] Adding another Model/*.pm file

Emily Heureux emily at burnham.org
Tue Mar 11 18:31:35 GMT 2008


I'm not sure which list this next problem should go to, but my subscription
is not approved yet on DBIx::Class...

 

I have two files in Model, because I want to add another DB connection:
Model/PlayDB.pm and Model/PMAPDB.pm.  The PlayDB.pm works and connects to a
different db that I want to eventually replace with DBIx::Class.  The
PMAPDB.pm is new, and looks like the source of my problem.

 

I also have a lib/PMAPDB.pm file and lib/PMAPDB dir, but I think those are
fine.

 

I tried establishing a connection to our current mysql db, worked out all
the errors except this one:

"UNIVERSAL::require() can only be run as a class method...".

 

If I comment out the gutts of Model/PMAPDB.pm, I don't have any errors.
Here is my Model/PMAPDB.pm:

 

package Play::Model::PMAPDB;

 

use strict;

use base 'Catalyst::Model::DBIC::Schema';

 

__PACKAGE__->config(

    schema_class => 'PMAPDB',

    connect_info => [

        'dbi:mysql:pmap_2007',

#        'username',

#        'password',

#        {AutoCommit => 1 },

        

    ],

);

 

1;

 

 

Also, just out of curiosity, could I theoretically just have one
Model/MyAppDB.pm file with connection info/params for both connections, and
also just have one lib/MyAppDB.pm schema file?  I did that first, but
changed it because I thought that was my problem.

 

Emily

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080311/c6901faa/attachment.htm


More information about the Catalyst mailing list