[Catalyst] Passing connection info to an custom model/external lib

Rodrigo rodrigolive at gmail.com
Fri Apr 10 19:50:51 GMT 2009


> The thing is I
> realized that if I connect to this schema outside of the scope of
> Catalyst via DBIx::Class::Schema->connect I have to pass in the
> connection info separately which really bugs me because I've already
> defined it via a configuration file for the Catalyst app (using
> Config::General). I suppose I could just pass that info into the model
> but that seems messy and redundant to me.


To me it doesn't seem messy to parse myapp.conf from your non-catalyst app
using Config::General->getall, then pass the connect_info data to your
DBIC::Schema class. Besides, you can use your MyApp::Schema classes from
anywhere, in case you created them with DBIC::Schema::Loader.
My 2c.

-rodrigo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090410/33e7e=
516/attachment.htm


More information about the Catalyst mailing list