[Catalyst] How do I use use DBIx::Class::Schema and Catalyst

Alex Kavanagh alex at tinwood.homelinux.org
Fri Feb 10 23:43:11 CET 2006


Hi

Sorry about the long delay - it took me a while to work out what was
going on with the Schema stuff.

At Tue, 7 Feb 2006 11:26:18 +0100,
Andreas Marienborg wrote:
> 
> 
> On 5. feb. 2006, at 22.01, Alex Kavanagh wrote:
> 
> > Hi
> >
> > On the DBIx mailing list it has been announced that
> > DBIx::Class::Loader has been deprecated in favour of
> > DBIx::Class::Schema::Loader.
> >
> 
> So I've heard :)
> 
> > I've been using the DBIx::Class::Loader and I'm wondering how to tie
> > the Schema stuff into Catalyst.  I think I'd like to do it manually
> > rather than use D::C::S::Loader because then I might actually learn
> > DBIx properly!
> >
> 
> I decided to use the Schema::Loader for now, but the rest of my info
> might be of good use :) We will see I guess.

I went straight to the manual stuff, especially after what I read on
the dbix-class mailing list.  Apparently the loader stuff is only to
get started and then you are expected to switch to manual
configuration for anything complicated.

[snip]

> 
> Usually I did
> 
> $c->model('ABook::Person')->find(<id>);
> 
> but now instead I have to do it like this:
> 
> $c->model('ABook')->resultset('Person')->find(<id>);
> 
> so a bit more typing, but if the Schema stuff is cool, I guess its
> worth it :)

Apparently, with the Catalyst::Model::DBIC::Schema you can still do

$c->model('ABook::Person')->find...

I've certainly used it on my recent hack of the DBIC Authentication
plugin (see my list post).

> 
> 
> hope that helps to get you started, but as for setting up the schema
> your self, I have no experience. Might be worth it running the Loader
> with debug => 1 to see what it does?

It took several days of reading the sources and I *think* I'm starting
to get there!!

Thanks
Alex.



More information about the Catalyst mailing list