2 use ExtUtils::MakeMaker;
4 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
5 # the contents of the Makefile that is written.
8 VERSION_FROM => 'lib/Maypole.pm', # finds $VERSION
10 Class::DBI::Loader => '0.02',
11 Class::DBI::AbstractSearch => 0,
12 Class::DBI::Pager => 0,
13 Class::DBI::Plugin::RetrieveAll => 0,
14 Class::DBI::AsForm => 2.2,
15 Class::DBI::FromCGI => 0.94,
16 Class::DBI::Loader::Relationship => 0,
19 UNIVERSAL::moniker => 0,
20 UNIVERSAL::require => 0,
23 Template::Plugin::Class => 0,
24 }, # e.g., Module::Name => 1.1
27 ? ## Add these new keywords supported since 5.005
29 ABSTRACT_FROM => 'lib/Maypole.pm', # retrieve abstract from module
30 AUTHOR => 'Simon Cozens <simon@simon-cozens.org>'
36 if ( !-e "t/beerdb.db" ) {
37 print "Making SQLite DB\n";
38 eval { require DBD::SQLite };
39 die "No, wait, we don't have SQLite installed. Never mind\n" if $@;
41 my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
43 my $sql = join( '', (<DATA>) );
45 for my $statement ( split /;/, $sql ) {
46 $statement =~ s/\#.*$//mg; # strip # comments
47 $statement =~ s/auto_increment//g;
48 next unless $statement =~ /\S/;
49 eval { $dbh->do($statement) };
50 die "$@: $statement" if $@;
56 create table brewery (
57 id integer auto_increment primary key,
64 id integer auto_increment primary key,
76 create table handpump (
77 id integer auto_increment primary key,
83 id integer auto_increment primary key,
90 id integer auto_increment primary key,
95 INSERT INTO beer (id, brewery, name, abv) VALUES
96 (1, 1, "Organic Best Bitter", "4.1");
97 INSERT INTO brewery (id, name, url) VALUES
98 (1, "St Peter's Brewery", "http://www.stpetersbrewery.co.uk/");
99 INSERT INTO pub (id, name) VALUES (1, "Turf Tavern");
100 INSERT INTO handpump (id, pub, beer) VALUES (1, 1,1);