[Catalyst] Implementing DBIx::Class
Emily Heureux
emily at burnham.org
Mon Mar 10 19:49:00 GMT 2008
Hi, I would REALLY like to implement DBIx::Class for our project that
currently uses a different database gateway. I would like to implement it
slowly if possible, and eventually 'unhook' our project from the old
gateway. This is what I would like to do. Can you tell me if this is
possible?
1) I am looking at the CatalystBasics tutorial, which I did some time
ago. I have a mysql database, and I want to add to the MyAppDB.pm file a
line like this: (Notice that I am only adding one table. Can I just add
one table to test?)
__PACKAGE__->load_classes({
MyAppDB => [qw/prot/]
});
2) Next, I think I would create a MyAppDB/prot.pm file, and load the
one table and columns just like in the tutorial. One question about this:
Do I have to establish relationships (many_to_many, etc) now, in this file,
like in the tutorial?
3) Then I need to run this line on the command line: (Can I replace
'tutorial' with anything I want?)
$ script/myapp_create.pl model MyAppDB DBIC::Schema MyAppDB dbi:mysql
'tutorial' '' '{ AutoCommit => 1 }'
Thanks,
Emily
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080310/27af53d2/attachment.htm
More information about the Catalyst
mailing list