Skip to contents

When called with no arguments, returns all settings as a data frame. When name is supplied and value is NULL, returns the value of that setting. When both name and value are supplied, executes SET <name> = <value>.

Usage

conn_setting(conn = conn_default(), name = NULL, value = NULL)

Arguments

conn

A DuckDB connection.

name

Optional character scalar. Setting name.

value

Optional value to set. Coerced to character; DuckDB casts it to the appropriate type.

Value

All settings: a tibble::tibble(). Single setting read: a character scalar. Write: conn invisibly.

Examples

conn <- DBI::dbConnect(duckdb::duckdb())
#> duckdb keeps downloaded extensions and secrets in a temporary directory:
#> ℹ /tmp/Rtmpq5OUnt/duckdb
#> This is removed when the R session ends.
#> • Extensions are re-downloaded each session.
#> • Secrets are lost.
#> ℹ Run duckdb(shared_home = TRUE) (or create ~/.duckdb) to keep them (suitable for most users).
#> ℹ Run duckdb(shared_home = FALSE) to accept the temporary directory (and silence this message).
#> ℹ See ?duckdb_storage for details and alternatives.
conn_setting(conn, "threads")
#> [1] "4"
DBI::dbDisconnect(conn, shutdown = TRUE)