5 my $db_file = "t/var/DBIxClass.db";
7 unlink($db_file) if -e $db_file;
8 unlink($db_file . "-journal") if -e $db_file . "-journal";
9 mkdir("t/var") unless -d "t/var";
11 my $dsn = "dbi:SQLite:${db_file}";
13 my $schema = DBICTest::Schema->compose_connection('DBICTest' => $dsn);
15 $schema->storage->on_connect_do([ "PRAGMA synchronous = OFF" ]);
17 my $dbh = $schema->storage->dbh;
19 open IN, "t/lib/sqlite.sql";
23 { local $/ = undef; $sql = <IN>; }
27 $dbh->do($_) for split(/\n\n/, $sql);
29 $schema->storage->dbh->do("PRAGMA synchronous = OFF");
31 $schema->populate('Artist', [
32 [ qw/artistid name/ ],
33 [ 1, 'Caterwauler McCrae' ],
34 [ 2, 'Random Boy Band' ],
38 $schema->populate('CD', [
39 [ qw/cdid artist title year/ ],
40 [ 1, 1, "Spoonful of bees", 1999 ],
41 [ 2, 1, "Forkful of bees", 2001 ],
42 [ 3, 1, "Caterwaulin' Blues", 1997 ],
43 [ 4, 2, "Generic Manufactured Singles", 2001 ],
44 [ 5, 3, "Come Be Depressed With Us", 1998 ],
47 $schema->populate('LinerNotes', [
48 [ qw/liner_id notes/ ],
49 [ 2, "Buy Whiskey!" ],
51 [ 5, "Kill Yourself!" ],
54 $schema->populate('Tag', [
67 $schema->populate('TwoKeys', [
74 $schema->populate('FourKeys', [
75 [ qw/foo bar hello goodbye/ ],
80 $schema->populate('OneKey', [
87 $schema->populate('SelfRef', [
93 $schema->populate('SelfRefAlias', [
94 [ qw/self_ref alias/ ],
98 $schema->populate('ArtistUndirectedMap', [
103 $schema->populate('Producer', [
104 [ qw/producerid name/ ],
105 [ 1, 'Matt S Trout' ],
106 [ 2, 'Bob The Builder' ],
107 [ 3, 'Fred The Phenotype' ],
110 $schema->populate('CD_to_Producer', [