
Manually applies sx resource limits (threads, memory) to a given DuckDB connection.
Source:R/utils_duckdb_config.R
sx_limit_duckdb_conn.RdManually applies sx resource limits (threads, memory) to a given DuckDB connection.
Arguments
- conn
A DuckDB connection object (from
DBI::dbConnect).- threads
Integer. Number of threads to use. If
NULL(default), uses the globalsx.duckdb.threadsoption. Providing a value pins the connection.- memory_limit_gb
Numeric or character. Memory limit to use. If
NULL(default), uses the globalsx.duckdb.memory_limit_gboption. Providing a value pins the connection.
Details
When threads or memory_limit_gb are explicitly provided, the connection is
"pinned" in an internal registry. Pinned connections are immune to global
policy enforcement (see sx_options(duckdb_enforcement_mode = "all")), ensuring
that manual engineering decisions are respected.
To unpin a connection and return it to global policy management, call this function without any limit arguments.