Learn R Programming

motherduck (version 0.2.0)

install_extensions: Install DuckDB/MotherDuck Extensions

Description

Installs valid DuckDB or MotherDuck extensions for the current connection.

Usage

install_extensions(.con, extension_names)

Value

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

Arguments

.con

A valid DBI connection (DuckDB / MotherDuck).

extension_names

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

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.

See Also

Other db-con: load_extensions(), show_motherduck_token(), validate_extension_install_status(), validate_extension_load_status()

Examples

Run this code
if (FALSE) {
con <- DBI::dbConnect(duckdb::duckdb(dbdir = tempfile()))

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

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

DBI::dbDisconnect(con)
}

Run the code above in your browser using DataLab