Help for this page

Select Code to Download


  1. or download this
    $ echo '
        create table articles (id integer not null, parsed text, primary k
    +ey (id));
        create table information (id integer not null, something text, pri
    +mary key (id));
        create table articles_information (articles_id integer not null, i
    +nformation_id integer not null, primary key (articles_id, information
    +_id), foreign key (articles_id) references articles (id), foreign key
    + (information_id) references information (id));
    ' | sqlite3 M15U.sqlite
    
  2. or download this
    use DBIx::Class::Schema::Loader qw();
    DBIx::Class::Schema::Loader->naming('preserve');
    ...
    my $foobar = $schema->resultset('Articles')->create({ id => 1, parsed 
    +=> 'foo bar' });
    $foobar->add_to_informations({ id => 1, something => 'quux' });
    $foobar->add_to_informations({ id => 2, something => 'fnord' });
    
  3. or download this
    $ echo .dump | sqlite3 M15U.sqlite | grep INSERT
    INSERT INTO "articles" VALUES(1,'foo bar');
    ...
    INSERT INTO "information" VALUES(2,'fnord');
    INSERT INTO "articles_information" VALUES(1,1);
    INSERT INTO "articles_information" VALUES(1,2);