Subject: | SQLite provides a nice throwaway DBI database |
The tests for this module need write access to a database. In many environments, this is tricky if not impractical.
The module probably predates SQLite, but can run with it as it stands, by:
DRIVER=SQLite make test
However, it would be nice if the SQLite driver is officially supported and encouraged - by making it the default driver. It would also be a good idea for the test to tidy up after itself if the driver is SQLite.
A patch is attached.
--- DBI.t
+++ DBI_patched.t
@@ -24,9 +24,9 @@
unless ($DRIVER) {
local($^W)=0; # kill uninitialized variable warning
- # I like mysql best, followed by Oracle and Sybase
+ # I like SQLite best, followed by mysql, Oracle and Sybase
my ($count) = 0;
- my (%DRIVERS) = map { ($_,$count++) } qw(Informix Pg Ingres mSQL Sybase Oracle mysql); # ExampleP doesn't work;
+ my (%DRIVERS) = map { ($_,$count++) } qw(SQLite Informix Pg Ingres mSQL Sybase Oracle mysql); # ExampleP doesn't work;
($DRIVER) = sort { $DRIVERS{$b}<=>$DRIVERS{$a} } DBI->available_drivers(1);
}
@@ -179,4 +179,6 @@
}
test 30,$h{strawberries}->{quantity}=42;
test 31,$h{strawberries}->{quantity}=42; # make sure update statement works when nothing changes
-test 32,$h{strawberries}->{quantity}==42;
+test 32,$h{strawberries}->{quantity}==42;
+
+rm DBNAME if $DRIVER eq 'SQLite' ;