Tries two strategies in order, succeeding as soon as one works:
Usage
ext_install(
name,
cache = ext_cache(),
repo = c("core", "community"),
conn = conn_default(),
verbose = NULL
)Arguments
- name
Character scalar. Extension name.
- cache
An
ext_cacheobject used by the manual fallback.- repo
"core"or"community". Determines which configured URL to use and, when no URL is set, which DuckDB install syntax to emit.- conn
A DuckDB connection. Defaults to
conn_default().- verbose
Logical or
NULL. WhenTRUE, emits a warning if the SQL install fails but the manual fallback succeeds. WhenNULL(default), uses thequak.install_verboseoption /QUAK_INSTALL_VERBOSEenv var. WhenFALSE, the fallback is silent. Either way, a SQL failure is never raised as an error on its own.
Details
SQL install: runs DuckDB's built-in
INSTALL(using the configured repository URL when one is set viarepo_set_urls(), theQUAK_CORE_REPO/QUAK_COMMUNITY_REPOenv vars, or thequak.core_repo/quak.community_repoR options).Manual fallback: when the SQL install fails (e.g. DuckDB cannot reach an HTTPS URL before
httpfsis loaded, whereas R'scurlcan), downloads the.duckdb_extensionfile, caches it, and copies it into the extension directory.
A SQL failure is never raised on its own — it only surfaces (as a warning,
when verbose = TRUE) if the manual fallback also runs. An error is raised
only when both strategies fail.
Idempotent — skips install if the extension is already installed
(checked via the duckdb_extensions() pragma).
Examples
if (FALSE) { # \dontrun{
# Requires network access to download the extension.
conn <- DBI::dbConnect(duckdb::duckdb())
ext_install("httpfs", conn = conn)
DBI::dbDisconnect(conn, shutdown = TRUE)
} # }