Skip to content
Prev 59 / 1559 Next

general status query on DBI etc

Vincent J. Carey, Jr. wrote:
Correct.  As of today no driver is compliant.
Yes, those plans are current.
Hmm, that was written sometime ago.  The unixODBC project has
been making quite a bit of progress, and the driver manager 
seems to be getting quite good (although I haven't tested it too
much).  My main concern back then was the lack of ODBC drivers.
Currently the open source DBMS (at least PostsgreSQL and MySQL)
seem to provide quite decent ODBC drivers.  The availability of
free/open source drivers on Linux/Unix/MacOS for Oracle, MS SQL
server, and others is still an issue, AFAIK; (there are good
commercial drivers for Unix, though).

My feeling is that an R-ODBC interface is critical -- certainly
on Windows, but also on Unix and probably on Mac (I'm not sure how
Mac deals w. DBMSs).
The current ROracle (same for RMySQL and, of less interest, RSQLite) 
is fairly close to the DBI.  All the functionality in the
DBI is available in these other packages.  From the user's point
of view, the only difference is the function names (close(con)
vs dbDisconnect(con), etc.).  These do not require very extensive
work to have them compliant with the DBI.  At the programming level
the issue is also straightforward -- the current implementations
are done using S3 style classes and probably should be migrated
to S4 classes.  (Somewhat ironically, both the Oracle and MySQL
interfaces were originally implemented in S4, ported backwards
to S3 style classes for R compatibility and now they can finally be
fully implemented with S4 classes.)   In terms of programming, I
think we're talking about a week's effort, or less.
When implementing a driver, the C portion is probably where the
most work is required.  I'm not very familiar with this code, but
perhaps moving to the DBI wouldn't be too difficult.  

Last december I wrote DBI interfaces on top of both the existing
RPgSQL and RODBC, but I thought (and Tim agreed with me) that
the resulting layering of S4 on top of S3 classes wasn't ideal,
so these DBI.RpSQL and DBI.RODBC packages were not made public.
Re: ODBC, see my comments above.

Re: R/JDBC, I'm not sure -- I have little experience with Java, so perhaps
others can comment.

The slow emergence of drivers for the DBI, in my opinion, is
the lack of volunteers.  Even when we were drafting the DBI the
participation was not exactly overwhelming, as you probably noticed
when you looked at the r-sig-db archives.  But I feel that it is
important to have a common interface to DBMS, one reason being
to abstract out (at least as far as R is concerned) the details
of getting your data into your analysis.  Thus in the long run we
should be deciding what DBMS to use based on their merits and not
on whether the R API to DBMS "A" is well thought out but not for "B"
(asumming they provide more or less similar functionality).

Moreover, I think that Perl's DBI/DBD, Java's JDBC, ODBC, and
Python's DB-API have proved the viability of this approach.
Of course, any flaws in the R/S DBI should be fixed -- but that's
just implementation:-)

  
    
Message-ID: <20020720231630.A18676@jessie.research.bell-labs.com>
In-Reply-To: <200207200058.UAA28110@capecod.bwh.harvard.edu>; from stvjc@channing.harvard.edu on Fri, Jul 19, 2002 at 08:58:49PM -0400