status update
Brad Fitzpatrick
brad at danga.com
Sun Jan 7 20:45:23 UTC 2007
Mogilers,
As of svn 665, almost all DBI/MySQL stuff is pushed down into
MogileFS::Store and Store::MySQL, _including_ all the schema
creating/upgrading that was previously in mogdbsetup. Also pushed down is
all the test harness stuff that was only MySQL before.
I've also mapped the DSN prefixes for Oracle, SQLite, and Postgres to
their class names:
if ($dsn =~ /^DBI:mysql:/i) {
$subclass = "MogileFS::Store::MySQL";
} elsif ($dsn =~ /^DBI:SQLite:/i) {
$subclass = "MogileFS::Store::SQLite";
} elsif ($dsn =~ /^DBI:Oracle:/i) {
$subclass = "MogileFS::Store::Oracle";
} elsif ($dsn =~ /^DBI:Pg:/i) {
$subclass = "MogileFS::Store::Postgres";
} else {
die "Unknown database type: $dsn";
}
If you run the test suite, by default it uses MogileFS::Store::MySQL, but
you can change that with with an environment variable:
$ MOGTEST_DBTYPE=SQLite perl -Ilib t/domains-classes.t
$ MOGTEST_DBTYPE=Oracle perl -Ilib t/domains-classes.t
So if anybody wants to add Postgres/Oracle support, you now need to touch
exactly one file.... just copy MySQL.pm to WhateverDB.pm and hack away...
everything's in there.
- Brad
More information about the mogilefs
mailing list