Attach a database to the currently running DuckDB and update the search_path to make the objects in the new database available without using fully qualified names

attach_db(
  conn_obj,
  duckdb_path,
  duckdb_alias = make.names(fs::path_ext_remove(fs::path_file(duckdb_path))),
  read_only = TRUE
)

Arguments

conn_obj

DBI connection to DuckDB

duckdb_path

path to the DuckDB file to attach

duckdb_alias

alias to use fir the newly attached database

read_only

whether it should be attached in read only mode