]> git.decadent.org.uk Git - maypole.git/blobdiff - ex/BeerDB.pm
update to BeerDB.pm to use env var for DSN details if provided
[maypole.git] / ex / BeerDB.pm
index 6d90b2eb7828f1c1566a1f25f3bfa443414a5d32..1e4291a1410737bf1964b90d1f1012690f883d27 100644 (file)
@@ -6,7 +6,7 @@ sub debug { $ENV{BEERDB_DEBUG} }
 # This is the sample application.  Change this to the path to your
 # database. (or use mysql or something)
 use constant DBI_DRIVER => 'SQLite';
-use constant DATASOURCE => 't/beerdb.db';
+use constant DATASOURCE => $ENV{BEERDB_DATASOURCE} || 't/beerdb.db';
 
 BEGIN {
     my $dbi_driver = DBI_DRIVER;