Checks if a spatial extension is available, and installs it in a DuckDB database
Arguments
- conn
A
DBIConnectionobject to a DuckDB database- upgrade
if TRUE, it upgrades the DuckDB extension to the latest version
- quiet
A logical value. If
TRUE, suppresses any informational messages. Defaults toFALSE.- extension
name of the extension to install, default is "spatial"
- repos
optional character string naming the repository to install the extension from (e.g.
"core","core_nightly", or"community"); a URL or path can also be supplied. IfNULL(default), core extensions known to DuckDB are installed fromcoreand any other extension fromcommunity, falling back to the other repository if that fails. Switching an already-installed extension to a different repository requiresupgrade = TRUE. See https://duckdb.org/docs/stable/extensions/installing_extensions.
Examples
if (FALSE) { # \dontrun{
## load packages
library(duckspatial)
library(duckdb)
# connect to in memory database
conn <- duckdb::dbConnect(duckdb::duckdb())
# install the spatial extension
ddbs_install(conn)
# disconnect from db
duckdb::dbDisconnect(conn)
# install the h3 community extension
conn <- duckdb::dbConnect(duckdb::duckdb())
ddbs_install(conn, extension = "h3")
duckdb::dbDisconnect(conn)
} # }
