[Catalyst] Making Catalyst and DBIC play nicely together

Danijel Milicevic Danijel.Milicevic at rawmode.org
Mon Aug 8 22:32:52 CEST 2005


Hello Catalyst and DBIx::Class list,

I've written a very basic module for Catalyst that'll setup a model
class based on DBIC. It's pretty much a equivalent to the CDBI::Plain
model.

You can checkout the code via SVN here:
http://svn.rawmode.org/repos/Catalyst-Model-DBIC-Plain

Or download the dist package here:
http://www.danijel.de/static/Catalyst-Model-DBIC-Plain-0.01.tar.gz

It includes a helper script, so everything you need to do to get you
started is a simple:

script/myapp_create.pl model DBIC DBIC::Plain [dbi:SQLite:/tmp/my.db]
(or whatever DB you use)

Things Catalyst/CDBI users might notice would be, that only the model
class inherits from Catalyst::Base, so the table classes are abstracted
and can be used in a non-Catalyst context as well. On the other hand you
can call them as objects through the model class via
$c->comp('DBIC')->class('MyTable');
It might be released to CPAN soon, but it does not make alot of sense as
long DBIC 0.01 is not released (might happen soon, so I heard).

Comments, critique and feedback welcome.

Regards,
Danijel Milicevic




More information about the Catalyst mailing list