I found no explicit guidance in DBI documentation on how to load the front-end (i.e. package:DBI
) and the back-end (e.g. package:odbc
).
Most examples in the documentation (but not all) attach package:DBI
to the search path and do not attach the back-end, e.g.:
library(DBI)
con <- dbConnect(odbc::odbc(), ...)
There was also a commit to favor this.
Why does the documentation use that method rather than e.g.:
# attaching only the back-end
library(odbc)
con <- dbConnect(odbc(), ...)
# attaching the back-end before attaching package:DBI
library(odbc)
library(DBI)
con <- dbConnect(odbc(), ...)
# attaching the back-end after attaching package:DBI
library(DBI)
library(odbc)
con <- dbConnect(odbc(), ...)
?
So far, I only found that the first alternative may cause issues, e.g. for package:duckdb
.