[Catalyst] Catalyst::Helper::Model::DBIC::SchemaLoader
Jonathan Rockway
jon at jrock.us
Mon Oct 2 21:58:33 CEST 2006
Just replace SQLite with mysql:
script/testapp_create.pl model SomeDB DBIC::Schema MyApp::Schema \
create=dynamic dbi:mysql:database
Then in your lib/TestApp/Modle/SomeDB.pm, add your username and
password, if necessary:
use strict;
use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__->config(
schema_class => 'MyApp::Schema',
connect_info => [
'dbi:mysql:database',
'USERNAME_HERE',
'PASSWORD_HERE'
],
);
The tutorial should work with MySQL, BTW, so give it a try. SQLite is
the "default" because it's easier to setup than a full-blown MySQL instance.
Regards,
Jonathan Rockway
Kevin Wong wrote:
> Thank you all for your guide. I do not receive the mail in my mail jbox,
> so that maybe I create a new thread here. Sorry about that, I will try
> to keep the same thread next time.
>
> I read through the
> http://search.cpan.org/~jrockway/Task-Catalyst-Tutorial-0.01/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod
>
> It's very simple and great. I've been able to follow that easily. My own
> problem is I could not build the sqlite3. The tar ball is broken
> somehow. But I will fix that. My big question is:
> My target database is MySQL, and Catalyst support MySQL. Would you
> please kindly give me some links, or some line that help me to start
> with MySQL. I've read one old doc last year about how to switch to
> MySQL, but could not find it now.
> Thank you for all your support.
>
> Best Regards,
>
> Kevin
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
More information about the Catalyst
mailing list