[Catalyst] CDBI integration

Pablo Collins pablo.collins at gmail.com
Fri Jun 9 21:58:14 CEST 2006


HI all,

I have a bunch of Class::DBI packages in a directory/namespace outside of
the catalyst app I'm building and I would like to make them available as the
model layer.

It looks like if you want a model layer in catalyst, each class has to be
inside the top-level namespace of the application. I would prefer to not
have to create a package for each catalyst model class that says "package
MyApp::Model::Foo; use base 'MyModel::Foo';" for each package. It would be
neat if you tell the config where your model files live and have catalyst
slurp them up.

Another thing: from looking at Catalyst::Model::CDBI::Plain it looks like
your model classes are supposed to inherit from Catalyst::Base and also
provide a constructor called 'new', but I was able to integrate my outside
CDBI classes into catalyst without inheriting from Catalyst::Base. Do model
classes have to inherit from Catalyst::Base? Base.pm doesn't seems to
provide any functionality that seems appropriate for a model.

One issue I am having however, is that when using the
Catalyst::Engine::HTTP, it doesn't cache database connections, so
development is rather slow. How do I set catalyst with
Catalyst::Engine::HTTP up to cache connections?

Cheers,

-Pablo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060609/08954da8/attachment.htm 


More information about the Catalyst mailing list