% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/db_resources.R
\name{ddbs_set_resources}
\alias{ddbs_set_resources}
\alias{ddbs_get_resources}
\title{Get or set connection resources}
\usage{
ddbs_set_resources(conn, threads = NULL, memory_limit_gb = NULL)

ddbs_get_resources(conn)
}
\arguments{
\item{conn}{A \code{DBIConnection} object to a DuckDB database}

\item{threads}{Integer. Number of threads to use. If \code{NULL} (default), the setting is not changed, and DuckDB engine will use all available cores it detects (warning, on some shared HPC nodes the detected number of cores might be total number of cores on the node, not the per-job allocation).}

\item{memory_limit_gb}{Numeric. Memory limit in GB. If \code{NULL} (default), the setting is not changed, and DuckDB engine will use 80\% of available operating system memory it detects (warning, on some shared HPC nodes the detected memory might be the full node memory, not the per-job allocation).}
}
\value{
For \code{ddbs_set_resources()}, invisibly returns a list containing the current system settings; for \code{ddbs_get_resources()}, visibly returns the same list for direct inspection.
}
\description{
Configure technical system settings for a DuckDB connection, such as memory limits
and CPU threads.
}
\examples{
\dontrun{
# Create a connection
conn <- ddbs_create_conn()

# Set resources: 1 thread and 4GB
ddbs_set_resources(conn, threads = 1, memory_limit_gb = 4)

# Check current settings
ddbs_get_resources(conn)

ddbs_stop_conn(conn)
}
}
