[Catalyst] Model configuration through .yml
swatt at infobal.com
Wed Jan 13 14:55:50 GMT 2010
It certainly is possible. We do it that way, with two YAML config files.
One has the schema_class (this is the one in the home area) and the
second has the connect_info (I guess the typed "connect_into" is just a
typo), which we put in a separate file in the site's directory, so we
can run several sites, only changing the db connection info. I can't see
an obvious explanation from these snippets, but it looks more like the
module loading is the problem, not the configuration. Maybe check the
modules load from a debugged Perl starting your app and then a manual
I've kind of gone off YAML for configuration, but since it took me 2
years to get my colleagues to edit them rather than raw Perl code, can't
Emmanuel Quevillon wrote:
> I'd like to know something, probably a basic problem but just to be sure.
> Is it possible to configure Application db connection into .yml
> configuration file like :
> schema_class: Schema::MyApp
> - dbi:Pg:dbname=myapp
> - user
> - password
> - options
> Actually i tried this way but I cannot connect to the database,
> neither start my application, perl is not able to locate my schema
> Here is the error:
> Couldn't load class (Schema::MyApp) because: Couldn't instantiate
> component "BiblioList::Model::MyAppDB", "Can't locate Schema/MyApp.pm
> in @INC
> I can make it working if I add into Model::MyApp this :
> __PACKAGE__->config( ... );
> I first did it, just adding 'schema_class' infos and leaving
> connect_info into config file and it works like a charm.
> However, the strange thing is that, other db connection I configured
> for other databases can connect correctly even if I use another Schema
> module like Schema::FooBarDB located under the same directory as
> For example in another confg file I load using
> I can define this
> schema_class: Schema::FooBarDB
> - ..
> and it connect correctly to my foobardb without throwing errors above.
> Is this normal behavior from Catalyst or is there something I am doing
> wrong or just a bug?
> Thanks for any hint.
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> Dev site: http://dev.catalyst.perl.org/
> This message was scanned by ESVA and is believed to be clean.
> Click here to report this message as spam.
More information about the Catalyst