Skip to content
Prev 26 / 1559 Next

Rdbi package plus draft proposal (was Re: Rdbi package)L

Timothy H. Keitt wrote:
What I meant to say was that we should add/consider a virtual driver
class to group all actual drivers.  Conceptually all the drivers
(RPgSQL, RODBC, etc) extend the driver virtual class.
I guess not.  The important thing is the ability to obtain the status
of the operation, so having it as part of the dbConnectionInfo is
indeed fine.  Perhaps the DBI should then specify the member names,
say "error.number" and "error.message" (say)?
Oops, obviously I missed them.  Now I see the make.db.names() in
PgSQL that I also missed.
Strictly speaking, probably we could get away without it, but I
think having a driver class extended by the various implementations
could be useful.  For instance, one thing that driver objects can
provide is help with conversions.  Data type mappings probably
are best specified for drivers -- not connections nor result sets.
For instance, suppose dbDataType is a generic that returns the
"closest" data type for the R object x on DBMS drv

     dbDataType(drv, x)

then as new drivers get written, they extend dbDataType in the
obvious way.  It would be possible to specify the driver as a
character string instead of the driver object and use a switch
statement inside the function, but this would be error-prone and
would require keeping the dbDataType up-to-date.

Similarly (but perhaps not as interesting) for mapping names
(identifiers) from R and the DBMS, as in make.db.names in RPgSQL.

Another use is for listing all open connections (not unlike what
showConnections/getConnections currently do in R). See below.
They would be similar to the current  showConnections/getConnection.
R-devel does, and I understand the 1.4 will have them as a library "methods".

Re: references, I know of two, John Chambers' "Programming with Data"
(green book) and V&R's "S Programming".

  
    
Message-ID: <20011008221513.A6236@jessie.research.bell-labs.com>
In-Reply-To: <3BC1FC59.1010200@keittlab.bio.sunysb.edu>; from tklistaddr@keittlab.bio.sunysb.edu on Mon, Oct 08, 2001 at 03:19:53PM -0400