in reply to Basic question on "Catalyst in 5 minutes"

I think that is something wrong in slides

perl script/blog_create.pl model DBIC DBIC::Schema Blog::Schema create static DBI:SQLite:root/catalyst

try to substitute static for dynamic like this:

perl script/blog_create.pl model DBIC DBIC::Schema Blog::Schema create dynamic DBI:SQLite:root/catalyst UPDATE:

i try to simulate problem reading the tutorial of the jrockway, and i got this error when i try to create schema:

lornbook:~/foo/blog/Blog lorn$ perl script/blog_create.pl model DBIC D +BIC::Schema Blog::Schema create=static DBI:SQLite:/tmp/foo exists "/Users/lorn/foo/blog/Blog/script/../lib/Blog/Model" exists "/Users/lorn/foo/blog/Blog/script/../t" DBIx::Class::Schema::Loader::make_schema_at(): No such column create o +n table posts at /usr/local/lib/perl5/site_perl/5.8.8/Catalyst/Helper +/Model/DBIC/Schema.pm line 119

Did you got this errors? i dont know what is this error, but using 'create dynamic' is not the solution

UPDATE - 2:

the problem is a "copy & paste" from the xul slides, i know its weird but, i try to digite CREATE TABLES posts... manually, and everything works now, when i start the App, they show me the tables posts 'Blog::Model::DBIC::Posts' :) ( in your posts they show only 'Blog::Model::DBIC')

Replies are listed 'Best First'.
Re^2: Basic question on "Catalyst in 5 minutes"
by panchoh (Initiate) on Aug 10, 2008 at 20:06 UTC
    Hi!

    I think I have found a bug in DBIx::Class::Schema::Loader, which relates to this copy&paste problem here.

    It seems that DBIx::Class::Schema::Loader does not like SQL constructs like this:

    CREATE TABLE foo
    (id INTEGER);
    
    but is happy with constructs like this:
    CREATE TABLE foo(
    id INTEGER);
    
    The problem seems to be where the opening parentheses lies.

    N.B. that SQLite is happy with either one.

    For what I can see from the Catalyst in 5 minutes presentation, the opening parentheses there is in a new line, and hence running

    $ script/blog_create model Blog DBIC::Schema Blog create=static dbi:SQLite:database.db
    
    is doomed to fail.

    Please, confirm that you can reproduce the situation. I intend to fill a bug report against DBIx::Class::Schema::Loader.

    Hope that it helps, fellow mongers.

    Update: The bug belonged in DBD-SQLite: bug #34408, and there is already a patch which solves the issue. Thanks, ilmari!