Skip to contents

Creates an in-memory DuckDB connection and ATTACHes one or more database files. The main database is attached as read-only (immutable ontologies). The optional extra database is attached as read-write (user-defined tables). A search path is set so that tables in extra shadow those in main.

Usage

codeminer_connect(main = NULL, extra = NULL)

Arguments

main

Path to the main (read-only) DuckDB database file. Defaults to the path from CODEMINER_DB_PATH env var or rappdirs::user_data_dir("codeminer").

extra

Optional path to an extra (read-write) DuckDB database file. If the file does not exist, it will be created with empty metadata tables.

Value

The DBI connection object, invisibly.

Details

If called with no arguments, uses the default database path from the CODEMINER_DB_PATH environment variable (or rappdirs default).