2 use ExtUtils::MakeMaker;
3 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
4 # the contents of the Makefile that is written.
7 VERSION_FROM => 'lib/Maypole.pm', # finds $VERSION
9 Class::DBI::Loader => '0.02',
10 Class::DBI::AbstractSearch => 0,
11 Class::DBI::Pager => 0,
12 Class::DBI::Plugin::RetrieveAll => 0,
13 Class::DBI::AsForm => 0,
14 Class::DBI::FromCGI => 0,
15 Class::DBI::Loader::Relationship => 0,
17 UNIVERSAL::moniker => 0,
18 UNIVERSAL::require => 0,
21 }, # e.g., Module::Name => 1.1
22 ($] >= 5.005 ? ## Add these new keywords supported since 5.005
23 (ABSTRACT_FROM => 'lib/Apache/MVC.pm', # retrieve abstract from module
24 AUTHOR => 'Simon Cozens <simon@nonet>') : ()),
27 if (!-e "t/beerdb.db") {
28 print "Making SQLite DB\n";
30 or die "No, wait, we don't have SQLite installed. Never mind\n";
32 my $dbh = DBI->connect("dbi:SQLite:dbname=t/beerdb.db");
34 my $sql = join ( '', (<DATA>) );
36 for my $statement (split /;/, $sql) {
37 $statement =~ s/\#.*$//mg; # strip # comments
38 $statement =~ s/auto_increment//g;
39 next unless $statement =~ /\S/;
40 eval { $dbh->do($statement) };
41 die "$@: $statement" if $@;
47 create table brewery (
48 id int not null auto_increment primary key,
55 id int not null auto_increment primary key,
67 create table handpump (
68 id int not null auto_increment primary key,
74 id int not null auto_increment primary key,
80 INSERT INTO beer (id, brewery, name, abv) VALUES
81 (1, 1, "Organic Best Bitter", "4.1");
82 INSERT INTO brewery (id, name, url) VALUES
83 (1, "St Peter's Brewery", "http://www.stpetersbrewery.co.uk/");
84 INSERT INTO pub (id, name) VALUES (1, "Turf Tavern");
85 INSERT INTO handpump (id, pub, beer) VALUES (1, 1,1);