% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/db_extension.R
\name{ddbs_install}
\alias{ddbs_install}
\title{Checks and installs the Spatial extension}
\usage{
ddbs_install(
  conn,
  upgrade = FALSE,
  quiet = FALSE,
  extension = "spatial",
  repos = NULL
)
}
\arguments{
\item{conn}{A \code{DBIConnection} object to a DuckDB database}

\item{upgrade}{if TRUE, it upgrades the DuckDB extension to the latest version}

\item{quiet}{A logical value. If \code{TRUE}, suppresses any informational messages.
Defaults to \code{FALSE}.}

\item{extension}{name of the extension to install, default is "spatial"}

\item{repos}{optional character string naming the repository to install the
extension from (e.g. \code{"core"}, \code{"core_nightly"}, or
\code{"community"}); a URL or path can also be supplied. If \code{NULL}
(default), the \code{core} repository is tried first, then \code{community}.
Switching an already-installed extension to a different repository requires
\code{upgrade = TRUE}. See
\url{https://duckdb.org/docs/stable/extensions/installing_extensions}.}
}
\value{
TRUE (invisibly) for successful installation
}
\description{
Checks if a spatial extension is available, and installs it in a DuckDB database
}
\examples{
\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)
}
}
