attach_ducklake() installs the ducklake DuckDB extension the first time
it is needed, so most sessions never call this function. It downloads the
extension now, and optionally the extensions for the other catalog
backends (postgres, sqlite, mysql), for the cases where the download has
to happen before a lake is attached: baking a container image, a CI setup
step, or a machine that is offline at attach time.
Value
Invisibly, NULL. Called for its side effect of installing the
DuckDB extensions into the local extension cache.
Details
Where the extension lands is decided by the duckdb R package (see
?duckdb::duckdb_storage). Extensions live under a "home" directory: the
duckdb.home option or DUCKDB_R_HOME when set, otherwise ~/.duckdb
when it exists (in an interactive session duckdb offers to create it the
first time it connects), otherwise a per-session temporary directory.
With the temporary directory the extension is gone when R exits and the
next session downloads it again. install_ducklake() reports the
directory it installed into and says so when that directory is temporary.
For scripts and CI, set DUCKDB_R_HOME in ~/.Renviron or the job's
environment to a directory that survives the session.
Note
On Windows the postgres and mysql extensions are not available
(MinGW toolchain). See attach_ducklake() for details.
Examples
if (FALSE) { # \dontrun{
install_ducklake()
install_ducklake(backend = "postgres")
install_ducklake(backend = c("postgres", "sqlite", "mysql"))
} # }
