[Catalyst] Catalyst::Helper::Model::DBIC::SchemaLoader

Jonathan Rockway jon at jrock.us
Mon Oct 2 18:21:59 CEST 2006


I'm pretty sure you want to do:

    script/testapp_create.pl model SomeDB DBIC::Schema MyApp::Schema \
                   create=dynamic dbi:SQLite:/path/to/the/database.db

The create=dynamic means that the schema info will be pulled from that
database (/path/to/the/database.db) every time the app loads.  This is
convenient, but many-to-many relations aren't going to work right.
Actually, JOINs might not work at all, depending on whether or not
SQLite keeps track of foreign keys.

Anyway create=dynamic will get you up-and-running, but you're going to
have to do a static schema sooner or later.  The
Catalyst::Manual::Tutorial will walk you through this:

http://search.cpan.org/~jrockway/Task-Catalyst-Tutorial-0.01/lib/Catalyst/Manual/Tutorial/CatalystBasics.pod

Please let us know if you have any problems.

Regards,
Jonathan Rockway

Kevin Wong wrote:
> Hi,
> I am new to the community, and willing to take any advice. I have
> installed Catalyst on Linux (Centos 4.1). Previously, I tried to install
> Cat on Windows but failed. I have created a test application, and able
> to run script/test_server.pl. I opened the webbrowser with no problem.
> But when I created a batabase I got this error:
> ..................
> script/test_create.pl model DBIC DBIC::SchemaLoader 'dbi:SQLite:test.db'
>  exists "/home/kevin/test/script/../lib/test/Model"
>  exists "/home/kevin/test/script/../t"
> Couldn't load helper "Catalyst::Helper::Model::DBIC::SchemaLoader",
> "Can't locate Catalyst/Helper/Model/DBIC/SchemaLoader.pm in @INC (@INC
> contains: /usr/lib/perl5/5.8.5/i386-linux-thread-multi
> .....................
> 
> I've checked if  this  module installed, and this is the result:
> ......
> install Catalyst::Helper::Model::DBIC::Schema
> CPAN: Storable loaded ok
> Going to read /root/.cpan/Metadata
>   Database was generated on Mon, 02 Oct 2006 10:39:56 GMT
> Catalyst::Helper::Model::DBIC::Schema is up to date (undef).
> .......
> 
> these a 2 ways that I created the database:
>  1- script/test_create.pl model DBIC DBIC::SchemaLoader
> 'dbi:SQLite:test.db'
> 2-
> 
> script/test_create.pl model Database DBIC::SchemaLoader dbi:SQLite:test.db
> 
> ........
> 
> Would someone please tell me what did I do wrong here? 
> 
> Thank you for your help.
> 
> Kevin
> 
> ------------------------------------------------------------------------
> Yahoo! Messenger with Voice. Make PC-to-Phone Calls
> <http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com>
> to the US (and 30+ countries) for 2¢/min or less.
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/

-- 
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