[R-sig-DB] default driver and connection

Gabor Grothendieck ggrothend|eck @end|ng |rom gm@||@com
Thu Jul 19 00:42:15 CEST 2007


On 7/18/07, Seth Falcon <sfalcon using fhcrc.org> wrote:
> "Gabor Grothendieck" <ggrothendieck using gmail.com> writes:
> > Thanks.  Is there also a way to discover whether SQLite or MySQL or
> > neither has been loaded.  Note that they could be loaded but not have
> > an open connection.
> >
> > Thus, I would like to do this or similar processing:
> >
> > If only one of MySQL or SQLite is loaded then use that one.
> > If neither is loaded use SQLite.
>
> What if both are loaded?
>
> I don't think there is a way currently to determine if SQLite() has
> yet been called.  However, if RSQLite is not loaded, it certainly has
> not been called ;-)  So perhaps you can get by with checking whether
> the package is loaded?
>
> Such a feature could be added, but I'm not convinced it would actually
> be useful for anything.
>

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.

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.




More information about the R-sig-DB mailing list