Skip to contents

Installs valid DuckDB or MotherDuck extensions for the current connection.

Usage

install_extensions(.con, extension_names)

Arguments

.con

A valid DBI connection (DuckDB / MotherDuck).

extension_names

A character vector of DuckDB/MotherDuck extension names to install.

Value

Invisibly returns NULL. A detailed CLI report of installation success/failure is printed.

Details

The install_extensions() function validates the provided DuckDB/MotherDuck connection, then checks which of the requested extensions are valid. Valid extensions that are not already installed are installed using the INSTALL SQL command. Invalid extensions are reported to the user via CLI messages. This function provides a summary report describing which extensions were successfully installed and which were invalid.

Unlike load_extensions(), this function focuses purely on installation and does not automatically load extensions after installing.

Examples

if (FALSE) { # \dontrun{
con <- DBI::dbConnect(duckdb::duckdb())

# Install the 'motherduck' extension
install_extensions(con, "motherduck")

# Install multiple extensions
install_extensions(con, c("fts", "httpfs"))

DBI::dbDisconnect(con)
} # }