6 my $schema = MyDatabase::Main->connect('dbi:SQLite:db/example.db');
8 # here's some of the sql that is going to be generated by the schema
9 # INSERT INTO artist VALUES (NULL,'Michael Jackson');
10 # INSERT INTO artist VALUES (NULL,'Eminem');
12 my @artists = (['Michael Jackson'], ['Eminem']);
13 $schema->populate('Artist', [
19 'Thriller' => 'Michael Jackson',
20 'Bad' => 'Michael Jackson',
21 'The Marshall Mathers LP' => 'Eminem',
25 foreach my $lp (keys %albums) {
26 my $artist = $schema->resultset('Artist')->search({
29 push @cds, [$lp, $artist->first];
32 $schema->populate('Cd', [
39 'Beat It' => 'Thriller',
40 'Billie Jean' => 'Thriller',
41 'Dirty Diana' => 'Bad',
42 'Smooth Criminal' => 'Bad',
43 'Leave Me Alone' => 'Bad',
44 'Stan' => 'The Marshall Mathers LP',
45 'The Way I Am' => 'The Marshall Mathers LP',
49 foreach my $track (keys %tracks) {
50 my $cdname = $schema->resultset('Cd')->search({
51 title => $tracks{$track},
53 push @tracks, [$cdname->first, $track];
56 $schema->populate('Track',[