Skip to contents

Loads the bundled Rducks DuckDB extension. The registration-safe R UDF path requires R API work to happen on the recorded main R thread; pass threads = "single" to set external_threads=1 and PRAGMA threads=1 explicitly. rducks_enable() also sets DuckDB's arrow_lossless_conversion=true option on the user connection; the extension applies the same setting to its internal connections so DuckDB-specific Arrow metadata is preserved for typed scalar-UDF, table, and query-stream marshalling. Use rducks_set_execution_plan() before scalar-UDF registration to select a non-reference marshalling or concurrency plan.

Usage

rducks_enable(
  con,
  extension_path = rducks_extension_path(),
  threads = c("unchanged", "single")
)

Arguments

con

A duckdb_connection.

extension_path

Extension path. Defaults to rducks_extension_path().

threads

Either "unchanged" or "single".

Value

con, invisibly.

Examples

# \donttest{
db <- duckdb::dbConnect(duckdb::duckdb(config = list(allow_unsigned_extensions = "true")))
rducks_enable(db)
rducks_release(db)
DBI::dbDisconnect(db)
# }