[R-sig-DB] default driver and connection

Seth Falcon @|@|con @end|ng |rom |hcrc@org
Thu Jul 19 02:00:37 CEST 2007


"Gabor Grothendieck" <ggrothendieck using gmail.com> writes:
> Although the best situation would be if I could discover whether
> the driver had been loaded, I agree that the next best thing
> is to just check whether the package has been loaded and will
> do it that way for now.

I'm not understanding why knowing whether or not one of the drivers
has been initialized via a call to SQLite() or MySQL() is useful.

I can see how finding open connections is useful, and you can do that
using dbListConnections.
>
> One other thing.  dbListConnections(SQLite()) lists SQLite
> connections and dbListConnections(MySQL()) lists MySQL
> connections but it would be nice if one could issue
> dbListConnections() and a combined list of both.  If one were
> open to using either then this would, for example, be a quick
> way to know if there were just one open connection and
> determine which of the two database systems it was associated
> with.   Both are DBIConnection objects so one is really just
> asking for a list of the DBIConnection objects.

dbListAllCons = function() {
    drivers = list(SQLite(), MySQL())
    unlist(lapply(drivers, dbListConnections))
}



-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org




More information about the R-sig-DB mailing list