pkgload icon indicating copy to clipboard operation
pkgload copied to clipboard

Loading DBI a second time breaks `dbConnect(RSQLite::SQLite())`

Open krlmlr opened this issue 1 year ago • 0 comments

I need a manual unloadNamespace(), before or after the second load_all(), to be actually able to use it. Should we unload all dependent namespaces when load_all() is reloading?

gert::git_clone("https://github.com/r-dbi/DBI")

pkgload::load_all("DBI")
#> ℹ Loading DBI
con <- dbConnect(RSQLite::SQLite(), ":memory:")
dbDisconnect(con)
rm(con)

# unloadNamespace("RSQLite")

pkgload::load_all("DBI")
#> ℹ Loading DBI
dbConnect(RSQLite::SQLite(), ":memory:")
#> Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'dbConnect' for signature '"SQLiteDriver"'

Created on 2023-06-19 with reprex v2.0.2

krlmlr avatar Jun 19 '23 13:06 krlmlr