FAQ
If I create an SQLite table using this:
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT,
password TEXT
);

Then when I try to create my model I get this:

[MyApp]$ script/myapp_create.pl model DBIC DBIC dbi:SQLite:myapp.db
exists "/test/MyApp/script/../lib/MyApp/Model"
exists "/test/MyApp/script/../t"
exists "/test/MyApp/script/../lib/MyApp/Model/DBIC.pm"
sqlite_sequence has no primary key at
/usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Loader.pm line 110
Segmentation fault
[MyApp]$

But if I remove the AUTOINCREMENT it works fine. I know that SQLite will
still increment the id for me even without the AUTOINCREMENT keyword, but it
seems like it should also work with the keyword.

Thanks,
H
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060319/30902913/attachment.htm

Search Discussions

  • Matt S Trout at Mar 20, 2006 at 12:38 pm

    hkclark at gmail.com wrote:
    If I create an SQLite table using this:
    CREATE TABLE user (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    username TEXT,
    password TEXT
    );

    Then when I try to create my model I get this:

    [MyApp]$ script/myapp_create.pl model DBIC DBIC dbi:SQLite:myapp.db
    exists "/test/MyApp/script/../lib/MyApp/Model"
    exists "/test/MyApp/script/../t"
    exists "/test/MyApp/script/../lib/MyApp/Model/DBIC.pm"
    sqlite_sequence has no primary key at
    /usr/lib/perl5/site_perl/5.8.5/DBIx/Class/Loader.pm line 110
    Segmentation fault
    [MyApp]$
    Please use Model::DBIC::Schema, the old DBIC model was a clone of the CDBI one
    and isn't nearly as good.
    But if I remove the AUTOINCREMENT it works fine. I know that SQLite
    will still increment the id for me even without the AUTOINCREMENT
    keyword, but it seems like it should also work with the keyword.
    Without the AUTOINCREMENT, SQLite does actual auto_increment. With it, it
    creates a fake table to pretend to be a sequence which complicates things
    substantially - and as such Loader and SchemaLoader (the latter of which you'd
    be using with M::DBIC::Schema) don't support it.

    --
    Matt S Trout Offering custom development, consultancy and support
    Technical Director contracts for Catalyst, DBIx::Class and BAST. Contact
    Shadowcat Systems Ltd. mst (at) shadowcatsystems.co.uk for more information

    + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedMar 20, '06 at 4:36a
activeMar 20, '06 at 12:38p
posts2
users2
websitecatalystframework.org
irc#catalyst

2 users in discussion

Matt S Trout: 1 post Kennedy Clark: 1 post

People

Translate

site design / logo © 2021 Grokbase