[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mogilefs
Subject:    status update
From:       brad () danga ! com (Brad Fitzpatrick)
Date:       2007-01-07 20:45:28
Message-ID: Pine.LNX.4.58.0701072038560.26166 () mailx
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic